From nobody Fri Oct 30 17:39:00 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jGSyD6Jk1z6xG6m for ; Fri, 30 Oct 2026 17:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jGSyD5MzRz4f4S for ; Fri, 30 Oct 2026 17:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793381940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H1K4V4Nbxj2ptDbh20CS3BzILiTvdg7pWVKbMIalLZU=; b=rLoYzREf+gvZJathfdc+KUrJT/8bKm1wT/eXT2l7EajA2ee7DaKRpKoLIqGFSxLyI4fuwv 2567ZhkCrTPn0knStDyoSPiQYy5on3jQTio9lLu5n4nuX9olVJHMSiUUuUAU4W749qM8cO S04axjhgZoH4IWK1LB38pTCf6eGvBUCni4sw4V3YEKqLlWxiNuPj58s634kXtDUh4qApMh 9Z5uRVPnlWLUGpMa5iieCJHpbIKDiJd6pWhM47HldsP/g4s+eSIHbRzOmYXYhyzQ/p3xAa +5qmACc1T7IbcGPTxJ56Ui24NPk4Wp4CWL2v8p2xYH9euRUXDmp+tdaAeyQqDg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793381940; b=pxGQqf181WIswgATTrXQAeno12SjuJ2mZfwQLhCoYnUpKusVGP2wu6eRvWf+OOUsjApoVX IbCGzaID9Pa4tCJEfQBPYVgn+XfC9grv2+VCex7BNBGhHwdFTmjqxLLdbQSuA0a2es2zyT JSvCRs7C5oUskgSSozbHTxq/ANsF/nJQMe6M4FY+fN6D79RD+TYluUwZgnJzBiFTSSpm5s xlN575bCAUWl63NXSxH7EDGILBj+IVXc80sr0A8b4Q/3FOPe6UG8UnGNK3v1fwfH7erY8q 5mfCPHfB92P8SpNJ8sqr5GaIaY7WkAQ0mUMKZC1+5jsFdt7nsieDct8R+i0qzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793381940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H1K4V4Nbxj2ptDbh20CS3BzILiTvdg7pWVKbMIalLZU=; b=R6bYZsXRiVpqNvzjmONoJT2VrP4VXnz5APjRgabdYsZ8xD2uy4K7Cdi/r95Ik6nDSolPKb 97GL8qjd1fTVtyf+PrjQhn4QjUpgiwbruIXBLcBotNWg5lzjcUCwGRv95ugJ2MPOfUh/jZ ViOSxkOKDkqYhpMokt8c67xCdhohgqlM6MVM4IMUCeJ16cU+sOZGiLzFQYQa3acoNcxJeA fpOk80LggZHUo3vEdDw5tCDzDVxboVjWPIOgy4N4Y7R99zFAReUI2rBTmfjI+yoA66tyX+ ZjBcdlFebY0gBsOXf3Tr66/zDTj4kMh6uv4ZV0lSoJV1151OjG5bsmpAIj/h8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jGSyD4gThzdpJ for ; Fri, 30 Oct 2026 17:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f32f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 30 Oct 2026 17:39:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Adrian Chadd From: Kevin Bowling Subject: git: b71d79c270ff - stable/15 - iwm: mask closed_rb_num to the RX ring size List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b71d79c270ff7561838cd7dfd2abb8b000cd4d64 Auto-Submitted: auto-generated Date: Fri, 30 Oct 2026 17:39:00 +0000 Message-Id: <6ae4d634.3f32f.53fa1b58@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b71d79c270ff7561838cd7dfd2abb8b000cd4d64 commit b71d79c270ff7561838cd7dfd2abb8b000cd4d64 Author: Adrian Chadd AuthorDate: 2026-10-17 21:32:51 +0000 Commit: Kevin Bowling CommitDate: 2026-10-30 17:38:26 +0000 iwm: mask closed_rb_num to the RX ring size iwm_notif_intr() reads hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff and loops while (sc->rxq.cur != hw) without masking hw to the ring size (512 entries for 9000-series MQ RX, 256 for legacy). If the hardware reports a value at or above the ring size, cur never equals hw: the loop walks stale ring entries indefinitely and the write-pointer update uses a bogus index. Linux iwlwifi masks the value (5eae443eb5e2) and OpenBSD has done the same since 9000-series support was added (3287dca4fa10). This was found while debugging an iwm crash on another BSD using the same driver lineage (DragonFly, upstream bug 3449) Locally tested: * 7260, 9260, STA mode PR: kern/299427 Submitted by: David Bidner Differential Revision: https://reviews.freebsd.org/D60824 (cherry picked from commit 461da47e45e7f8ef8754875f4820d3855e7f4097) --- sys/dev/iwm/if_iwm.c | 2 ++ sys/dev/iwm/if_iwmvar.h | 1 + 2 files changed, 3 insertions(+) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 1e9090310ece..e07879ee0291 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -5640,6 +5640,8 @@ iwm_notif_intr(struct iwm_softc *sc) } hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff; + /* Mask the returned value to the hardware ring size */ + hw &= (count - 1); /* * Process responses diff --git a/sys/dev/iwm/if_iwmvar.h b/sys/dev/iwm/if_iwmvar.h index f31057c07b9b..c7d5efe6bb95 100644 --- a/sys/dev/iwm/if_iwmvar.h +++ b/sys/dev/iwm/if_iwmvar.h @@ -285,6 +285,7 @@ struct iwm_tx_ring { int cur; }; +/* Note: these are used as a mask; must be a power of 2 */ #define IWM_RX_LEGACY_RING_COUNT 256 #define IWM_RX_MQ_RING_COUNT 512