Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795154242; b=sxxCFHRPcKx8A4Ns7+80F0/vwV3vkAOyWtFGDRgn8+jysk2/2Nx8OS9CYf7L+wPL8Pd0 zs56d9hk4Mr77ZFDSdTT8yA5bQ0lw4kTbBzpzTcbSrqe/K4P9H3YLQJjbRfh8uSPCDyFi Dl7PWFYJkharEn5HAW4WCDUuLQ5AFjXfd8aampUHgE+dgFbAwI/TkXAiIgkPiNZm5xmJm /bKoQI/Bibazgacijx08cNlrNlfaHv7NDhqKQGXuNjpYd9JCHDqEUU5wd2OS8JIVhGibp 0FWZoBv7A3TvNGilfmp4qJNz1q2idfL4aQzcPoeDaS2vQdQyttlKw3yAXkjECEGvU6w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795154242; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=6zAHdSnNF4UBTxv6GfidRhLZWgNJRWatSHduOXfrKN4=; b=FNuGKFmWBmSfApXcE+yA1ktgl0kQ9/Ux6cDmu/tYn0iWLIenyoYH3ZTbEnsadhOsREhg Mx+kEkEwj+uh6xoheJzaV0FJbvTWD6OczYOyl45/lyn9N6wOE38NDL/J+GVmHVABOI/Pa Ko+A3vyPK1mRPG8H13wbX86zultW+vXWesFDTSIYptEUriz955Xho5e9+NiFSGsUIhjCX SCUkK2oNc+saCmU5z58XisXCCSUdhYYPsWitk+8Zdsj2lVc3qQ6PNE1V2zoHtfgYbO1iM B63O4iaK1uS0q8c3nKzGfHoUdCEfXb3SZdQdd0Bfe7uPLAxOFoBGuX8TiJe/XIsg07A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="woqy/QQr"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6802160A2612 for ; Fri, 20 Nov 2026 05:57:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=woqy/QQr Received: by smtp.kernel.org (Postfix) with ESMTPSA id B62841F000D0; Fri, 20 Nov 2026 05:57:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795154242; bh=6zAHdSnNF4UBTxv6GfidRhLZWgNJRWatSHduOXfrKN4=; h=From:To:Cc:Subject:Date:Reply-To; b=woqy/QQrV6pycvTDiaMrJiN0+2WAt4+vOcUt/EBWTpzNtHyUlTE6gJwD6YQdNropl a1T+WBJQKJxNJVbJ/rKBaQiWJtq4BS7h/UFHY2xYLUW8OZ5qTQCZAPVWeWRAPF9qLC vK7LyXmMRWrOOD7VARwnyGDvITEiWY9QXUJB2huY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99638: net/sched: clamp skb->queue_mapping before indexing the tx queue Date: Fri, 20 Nov 2026 06:50:24 +0100 Message-ID: <2026112039-CVE-2026-99638-5a9d@gregkh> X-Mailer: git-send-email 2.56.1 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6687; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xhDNl6pVhAPA5IBYzpiIx8n7E/DPmpW0bfCUa55RpIE=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/7xcH/tJ5zhS8cfPPLXnfXn68d2qjniBPtH/FouPmn 090zTP+3RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATmeHDsGDJxewZs789qJwb cOqBwpOFa05sk61kmJ+19CV3Z7r+vXC/9pPCgW4x0XyidgA= 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: net/sched: clamp skb->queue_mapping before indexing the tx queue This issue was caught by Sashiko (nipa). A producer-side path cap is already merged (ea4d4b5dddb5); this patch adds the matching consumer-side caps. The issue: The tx queue is picked and capped in netdev_core_pick_tx() before the __dev_xmit_skb() qdisc enqueue path. A tc BPF program running inside an egress qdisc (not clsact) can then change __sk_buff->queue_mapping; that store is never re-checked. bpf_convert_ctx_access() bounds it only by NO_QUEUE_MAPPING, not by the device's queue count. Two consumers read the stale value: - On dequeue, qdisc_restart() calls netdev_get_tx_queue(), which indexes dev->_tx[]. netdev_get_tx_queue() guards it with just a DEBUG_NET_WARN_ON_ONCE, so sch_direct_xmit() takes the out-of-bounds txq->_xmit_lock and writes txq->xmit_lock_owner past the end of the allocation on non-lltx devices such as ifb. Drivers that index their rings from skb_get_queue_mapping() (ex: ifb) go out of range the same way. - On enqueue, taprio_enqueue() indexes q->qdiscs[] with the same value; the array is sized dev->num_tx_queues. A duplicating netem on a child qdisc clones the skb and re-enqueues the clone at the taprio root (qdisc_root_bh()) through a direct rootq->enqueue() call, so the value reaches taprio_enqueue() before any dequeue cap runs. The Fix: Cap the mapping at the consumers and write the capped value back, so the qdisc's _tx[] lookup, the taprio q->qdiscs[] lookup and any later driver read stay in range. On the dequeue side the cap folds into the dequeue path instead of a separate walk over the returned list: dequeue_skb() caps the head, and each bulk helper caps the element it appends. For a qdisc that is not TCQ_F_ONETXQUEUE, netdev_cap_txqueue() logs a ratelimited notice and selects queue 0. A TCQ_F_ONETXQUEUE qdisc is bound to a single tx queue: dequeue_skb() uses q->dev_queue for the frozen check, the BQL limit and the trace point, while qdisc_restart() transmits on the skb's queue. Capping an out-of-range mapping to queue 0 would therefore send a per-queue child's skb through a different queue than the one it was dequeued for. On mq, mqprio, taprio and htb offload children, a stopped queue 0 could then park the list in q->gso_skb, and the later wake would schedule queue 0's own child instead of this qdisc. Pin a TCQ_F_ONETXQUEUE mapping to the qdisc's own queue to keep the documented invariant. The pin covers every mapping, not only an out-of-range one: an in-range mapping that a filter sets on one of those per-queue children is rewritten to the child's own queue, and this path does not call netdev_cap_txqueue(), so it logs no notice. On a single-queue device qdisc_create() sets TCQ_F_ONETXQUEUE, so the one-queue trigger described below also takes this branch and is corrected without a notice. That also keeps a bulk list on one queue by construction: every element of a TCQ_F_ONETXQUEUE qdisc, including a follower changed by a filter, is pinned to q->dev_queue before it is appended. The fast bulk helper therefore needs no head comparison and no skb_bad_txq requeue; the slow helper, used only by non-ONETXQUEUE qdiscs, still compares and requeues a mismatched follower, where a wake on any queue reschedules q. On the enqueue side taprio_enqueue() caps the mapping against real_num_tx_queues and writes it back before selecting q->qdiscs[queue], so a duplicating child cannot steer the clone out of the array. Conditions to recreate the bug: The dequeue path: load a SCHED_CLS or SCHED_ACT program that stores __sk_buff->queue_mapping (a tc BPF action is enough), attach it to a transmit qdisc (for example a matchall filter on a prio root), and send a packet. With a 1-queue device a store of 1 indexes one past dev->_tx[]. Under KASAN with panic_on_warn=1 the unfixed kernel faults with "BUG: KASAN: slab-out-of-bounds in sch_direct_xmit". Loading the program needs CAP_BPF/CAP_SYS_ADMIN, so the trigger is root. The enqueue path: on a multi-queue device, install a software taprio root, graft a prio child with a duplicating netem on every class, and store an out-of-range queue_mapping from a matchall+bpf filter on the prio. The duplicate is re-enqueued at the taprio root and indexes q->qdiscs[] past dev->num_tx_queues; the unfixed kernel faults in taprio_enqueue_one(). Same CAP_BPF/CAP_SYS_ADMIN requirement. The Linux kernel CVE team has assigned CVE-2026-99638 to this issue. Affected and fixed versions =========================== Issue introduced in 5.1 with commit 74e31ca850c1cddeca03503171dd145b6ce293b6 and fixed in 6.12.118 with commit 8182ba13500b39d75b66fe9f37e13cb325c4b17e Issue introduced in 5.1 with commit 74e31ca850c1cddeca03503171dd145b6ce293b6 and fixed in 6.18.64 with commit 7445eccce376f7adb876c9f466d7d893344af7ce Issue introduced in 5.1 with commit 74e31ca850c1cddeca03503171dd145b6ce293b6 and fixed in 7.3.5 with commit 7327092a678bfcb1bae033acb1be1006a1399e30 Issue introduced in 5.1 with commit 74e31ca850c1cddeca03503171dd145b6ce293b6 and fixed in 7.4-rc2 with commit f19f2b308beb158d0e6f6eb806ced636e4ebf6ce 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-99638 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: net/sched/sch_generic.c net/sched/sch_taprio.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/8182ba13500b39d75b66fe9f37e13cb325c4b17e https://git.kernel.org/stable/c/7445eccce376f7adb876c9f466d7d893344af7ce https://git.kernel.org/stable/c/7327092a678bfcb1bae033acb1be1006a1399e30 https://git.kernel.org/stable/c/f19f2b308beb158d0e6f6eb806ced636e4ebf6ce