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 92B023B19AC for ; Wed, 25 Mar 2026 10:30:15 +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=1774434615; cv=none; b=nXySauDs9kb0O+atlndUyiQAyD/+Yw9nIr1Ij2MzhraI9P6ulfrqujhxagzWvurH9Odtth9/BZhnRKm3i1AqMC46wYZQJAdhnlVX4v8JITuilleQbZNlGNq/oJoI1Z3z8lm9wlRV8I/gTl+0EvopCa8zhH5MzDce1hCaqlIDnPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774434615; c=relaxed/simple; bh=pjyej6SHfucY/T3d3gYFWE34DdyL/UTFZyLD1MwWfSE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BzNrquIMgIaHx3pnq2ItZZFO/AlZpgLLTUWpjW3NOwrZMuwFtUnZQwDbFuvRX6vxcMPzTb6HyVVb7V6aVfyrU1wXOBg8XgsAUriwJLED8vXszUoaJRphvGEN5n/amP2jXkZtZD5RTMzR09rSLJDE73vMj2cOFUtceCG1rKrDooY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f1NOlCvX; 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="f1NOlCvX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E04C5C2BC9E; Wed, 25 Mar 2026 10:30:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774434615; bh=pjyej6SHfucY/T3d3gYFWE34DdyL/UTFZyLD1MwWfSE=; h=From:To:Cc:Subject:Date:Reply-To:From; b=f1NOlCvXi7dsiDrEIzzx9+euMhkSStDgFERSO3tIo3HI8ELW/PEIYqpbxHvwcBMXL 7xklJHCoYFT6o9A3I9QUGGCFtVbXyjwhLt9+7J6Pnypieq5kFAZOq5aNQxb+GziZVs ukr4ho3DmjNbNc+hZjubfrGh+USXsfBvc/ymuL6c= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-23342: bpf: Fix race in cpumap on PREEMPT_RT Date: Wed, 25 Mar 2026 11:27:26 +0100 Message-ID: <2026032535-CVE-2026-23342-8456@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=4819; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=imx5Hl6Sk5vAqOC3o2kAepxvGByRSwZM6baAzBGBy8w=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmHd0SbtPDr9xyZ5M7ds2u2+/bDjROEJ2l2/H5y0/rRb ItXKjrPOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiG9YzLNi4ZKrB4a2pf640 Bhff4/j81DPIQo1hforfYol17C+aBFb9MDZjs7y+ucaEAQA= 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 cpumap on PREEMPT_RT On PREEMPT_RT kernels, the per-CPU xdp_bulk_queue (bq) can be accessed concurrently by multiple preemptible tasks on the same CPU. The original code assumes bq_enqueue() and __cpu_map_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_flush_to_queue(), 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 __list_del_clearprev(): after bq->count is reset in bq_flush_to_queue(), a preempting task can call bq_enqueue() -> bq_flush_to_queue() on the same bq when bq->count reaches CPU_MAP_BULK_SIZE. Both tasks then call __list_del_clearprev() on the same bq->flush_node, the second call dereferences the prev pointer that was already set to NULL by the first. 2. bq->count and bq->q[] races: concurrent bq_enqueue() can corrupt the packet queue while bq_flush_to_queue() is processing it. The race between task A (__cpu_map_flush -> bq_flush_to_queue) and task B (bq_enqueue -> bq_flush_to_queue) on the same CPU: Task A (xdp_do_flush) Task B (cpu_map_enqueue) ---------------------- ------------------------ bq_flush_to_queue(bq) spin_lock(&q->producer_lock) /* flush bq->q[] to ptr_ring */ bq->count = 0 spin_unlock(&q->producer_lock) bq_enqueue(rcpu, xdpf) <-- CFS preempts Task A --> bq->q[bq->count++] = xdpf /* ... more enqueues until full ... */ bq_flush_to_queue(bq) spin_lock(&q->producer_lock) /* flush to ptr_ring */ spin_unlock(&q->producer_lock) __list_del_clearprev(flush_node) /* sets flush_node.prev = NULL */ <-- Task A resumes --> __list_del_clearprev(flush_node) flush_node.prev->next = ... /* prev is NULL -> kernel oops */ Fix this by adding a local_lock_t to xdp_bulk_queue and acquiring it in bq_enqueue() and __cpu_map_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. To reproduce, insert an mdelay(100) between bq->count = 0 and __list_del_clearprev() in bq_flush_to_queue(), then run reproducer provided by syzkaller. The Linux kernel CVE team has assigned CVE-2026-23342 to this issue. Affected and fixed versions =========================== Issue introduced in 6.18 with commit 3253cb49cbad4772389d6ef55be75db1f97da910 and fixed in 6.18.17 with commit 7466ae2aeed483de80c5d8dea0913cf74038b652 Issue introduced in 6.18 with commit 3253cb49cbad4772389d6ef55be75db1f97da910 and fixed in 6.19.7 with commit e67299e1044349ad0088d52c6bc5764cc1816c06 Issue introduced in 6.18 with commit 3253cb49cbad4772389d6ef55be75db1f97da910 and fixed in 7.0-rc2 with commit 869c63d5975d55e97f6b168e885452b3da20ea47 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-23342 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/cpumap.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/7466ae2aeed483de80c5d8dea0913cf74038b652 https://git.kernel.org/stable/c/e67299e1044349ad0088d52c6bc5764cc1816c06 https://git.kernel.org/stable/c/869c63d5975d55e97f6b168e885452b3da20ea47