Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 860FB396D28 for ; Wed, 25 Mar 2026 10:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774434457; cv=none; b=gUYqJuq48aZsu7Id9YVhwHXXTvytVtx0BMS8ZStYEq9ynO5IO/iYKU0anBKXMjmwQEPC3yZDUcNXoiIfyQRtK+kldJ4tTlqwE1NGWmd9eDYL9H6VbhfALgFeBXdTuM609RhdJCBO2PPDAu00boFxcANQNJK7Ud79Q0olZCF82/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774434457; c=relaxed/simple; bh=UNyZ1AXomzRsB8YJcAf/3IkdvKDKIM8DFfMUZ5FJHUg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ko6gTEGdgCz+czd04oLoyOTrYgbfs3tEaQ07Fzgc0OIOPY3M7KvmDD+VED2DQXnyGIfjpa+EjhEiC3dw3XWFSvCav93LPFezzT02wbsCaLyOVbYUpS0S58uqs9GCirlc7SwQBq5xv9XDO9v8+rDozfdG+rmUWr0l0D7prQQK/8Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=I1+9cluv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="I1+9cluv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B458EC4CEF7; Wed, 25 Mar 2026 10:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774434457; bh=UNyZ1AXomzRsB8YJcAf/3IkdvKDKIM8DFfMUZ5FJHUg=; h=From:To:Cc:Subject:Date:Reply-To:From; b=I1+9cluvEtf4nr7u2AsGk8FQlk1u6EDPyW+Fu/FGphG4YhUROeg3L7/aAglk7hHcp a3/Qlo18un8ZZ2oKqbtgsI3piIxVClO+CF0qJ0ybe/j1sMf58aPCva9DDAVVRP6gAX Fk2DO5zP5YtTBYxm9a4Gf7VAXB6H9i4l1Y18cBco= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-23294: bpf: Fix race in devmap on PREEMPT_RT Date: Wed, 25 Mar 2026 11:26:38 +0100 Message-ID: <2026032525-CVE-2026-23294-1682@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5105; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=kwthZPZQ1/7ZuYD6179W01Fao+z/3tu+g+pBb4mN2O4=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmHdwQeYH68kyM53FV5Ue6OpsebCu/bHzObEbG0yf/V+ mfLohrfdsSwMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEOhgY5hkIbq3ecvPLa0et x2+dzho84ZfZcZBhxrmgKXc6rcs2nm0/xPThusrpubckAQ== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: bpf: Fix race in devmap on PREEMPT_RT On PREEMPT_RT kernels, the per-CPU xdp_dev_bulk_queue (bq) can be accessed concurrently by multiple preemptible tasks on the same CPU. The original code assumes bq_enqueue() and __dev_flush() run atomically with respect to each other on the same CPU, relying on local_bh_disable() to prevent preemption. However, on PREEMPT_RT, local_bh_disable() only calls migrate_disable() (when PREEMPT_RT_NEEDS_BH_LOCK is not set) and does not disable preemption, which allows CFS scheduling to preempt a task during bq_xmit_all(), enabling another task on the same CPU to enter bq_enqueue() and operate on the same per-CPU bq concurrently. This leads to several races: 1. Double-free / use-after-free on bq->q[]: bq_xmit_all() snapshots cnt = bq->count, then iterates bq->q[0..cnt-1] to transmit frames. If preempted after the snapshot, a second task can call bq_enqueue() -> bq_xmit_all() on the same bq, transmitting (and freeing) the same frames. When the first task resumes, it operates on stale pointers in bq->q[], causing use-after-free. 2. bq->count and bq->q[] corruption: concurrent bq_enqueue() modifying bq->count and bq->q[] while bq_xmit_all() is reading them. 3. dev_rx/xdp_prog teardown race: __dev_flush() clears bq->dev_rx and bq->xdp_prog after bq_xmit_all(). If preempted between bq_xmit_all() return and bq->dev_rx = NULL, a preempting bq_enqueue() sees dev_rx still set (non-NULL), skips adding bq to the flush_list, and enqueues a frame. When __dev_flush() resumes, it clears dev_rx and removes bq from the flush_list, orphaning the newly enqueued frame. 4. __list_del_clearprev() on flush_node: similar to the cpumap race, both tasks can call __list_del_clearprev() on the same flush_node, the second dereferences the prev pointer already set to NULL. The race between task A (__dev_flush -> bq_xmit_all) and task B (bq_enqueue -> bq_xmit_all) on the same CPU: Task A (xdp_do_flush) Task B (ndo_xdp_xmit redirect) ---------------------- -------------------------------- __dev_flush(flush_list) bq_xmit_all(bq) cnt = bq->count /* e.g. 16 */ /* start iterating bq->q[] */ <-- CFS preempts Task A --> bq_enqueue(dev, xdpf) bq->count == DEV_MAP_BULK_SIZE bq_xmit_all(bq, 0) cnt = bq->count /* same 16! */ ndo_xdp_xmit(bq->q[]) /* frames freed by driver */ bq->count = 0 <-- Task A resumes --> ndo_xdp_xmit(bq->q[]) /* use-after-free: frames already freed! */ Fix this by adding a local_lock_t to xdp_dev_bulk_queue and acquiring it in bq_enqueue() and __dev_flush(). These paths already run under local_bh_disable(), so use local_lock_nested_bh() which on non-RT is a pure annotation with no overhead, and on PREEMPT_RT provides a per-CPU sleeping lock that serializes access to the bq. The Linux kernel CVE team has assigned CVE-2026-23294 to this issue. Affected and fixed versions =========================== Issue introduced in 6.18 with commit 3253cb49cbad4772389d6ef55be75db1f97da910 and fixed in 6.18.17 with commit 6c10b019785dc282c5f45d21e4a3f468b8fd6476 Issue introduced in 6.18 with commit 3253cb49cbad4772389d6ef55be75db1f97da910 and fixed in 6.19.7 with commit ab1a56c9d99189aa5c6e03940d06e40ba6a28240 Issue introduced in 6.18 with commit 3253cb49cbad4772389d6ef55be75db1f97da910 and fixed in 7.0-rc2 with commit 1872e75375c40add4a35990de3be77b5741c252c Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-23294 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: kernel/bpf/devmap.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/6c10b019785dc282c5f45d21e4a3f468b8fd6476 https://git.kernel.org/stable/c/ab1a56c9d99189aa5c6e03940d06e40ba6a28240 https://git.kernel.org/stable/c/1872e75375c40add4a35990de3be77b5741c252c