CVE-2026-74736: net/sched: cls_bpf: reject dev-bound programs bound to a different device
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net/sched: cls_bpf: reject dev-bound programs bound to a different device
cls_bpf_prog_from_efd() obtained a SCHED_CLS program via bpf_prog_get_type_dev() but never verified that a device-bound (offloaded) program's bound netdev matches the TC netdev the classifier is being attached to. This let a program loaded with prog_ifindex for device A be attached via cls_bpf + skip_sw to device B; deleting device A then destroyed the program's offload state while it was still attached to device B, triggering a netdevsim WARN (panic with panic_on_warn=1).
Mirror the XDP attach path (net/core/dev.c) and reject the attach with -EINVAL when a dev-bound program's bound device does not match the target device.
The Linux kernel CVE team has assigned CVE-2026-74736 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.3 with commit 2b3486bc2d237ec345b3942b7be5deabf8c8fed1 and fixed in 6.6.153 with commit ec5a552f4b2d841c6c021752450716e1a9676661 Issue introduced in 6.3 with commit 2b3486bc2d237ec345b3942b7be5deabf8c8fed1 and fixed in 6.12.105 with commit daf546ab5763ce6a18280cb4db060e836c515301 Issue introduced in 6.3 with commit 2b3486bc2d237ec345b3942b7be5deabf8c8fed1 and fixed in 6.18.46 with commit adb3e7c26a51a10d94a241c6de7a81a2863dcacf Issue introduced in 6.3 with commit 2b3486bc2d237ec345b3942b7be5deabf8c8fed1 and fixed in 7.1.10 with commit 5685bbbd3cbfbeb0de96a1d275a5ca073dfebb5e Issue introduced in 6.3 with commit 2b3486bc2d237ec345b3942b7be5deabf8c8fed1 and fixed in 7.2 with commit 120977e2c096deea4e866e4273be9220b957c29e
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-74736
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/cls_bpf.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/ec5a552f4b2d841c6c021752450716e1a9676661 https://git.kernel.org/stable/c/daf546ab5763ce6a18280cb4db060e836c515301 https://git.kernel.org/stable/c/adb3e7c26a51a10d94a241c6de7a81a2863dcacf https://git.kernel.org/stable/c/5685bbbd3cbfbeb0de96a1d275a5ca073dfebb5e https://git.kernel.org/stable/c/120977e2c096deea4e866e4273be9220b957c29e