CVE-2026-100018

netdevsim: reject cls_bpf programs bound to another device

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

netdevsim: reject cls_bpf programs bound to another device

The issue:
nsim_bpf_setup_tc_block_cb() installs any device-bound SCHED_CLS program
without checking that its offload device matches the target netdev. The
core cls_bpf attach path rejects a mismatching program, but a netdev that
joins a shared block later is replayed the stored filter by
cls_bpf_reoffload() before it is inserted into block->ports, so the
attach-time check cannot see it. The driver callback is the
authoritative per-device acceptance boundary and must enforce the match
itself, as nfp already does in nfp_net_bpf_offload().

Without the check, replaying a device-bound program onto a different
bpf_offload_dev installs it into that device's netdevsim state, which
trips the WARN in nsim_bpf_uninit() (ns->bpf_offloaded set on a foreign
device) and can dereference a NULL prog->aux->offload in
nsim_prog_set_loaded().

The Fix:
Reject a device-bound program whose offload device does not match the
target netdev, with -EINVAL and an extack so the rejected replay is not
silent. The check is intentionally narrower than nfp's: it fires only
for a dev-bound program, so nsim's bpf_tc_non_bound_accept mode (which
admits an unbound program onto the device) is unaffected. Teardown is
never blocked: the guard is on the program being installed and an unbind
passes cls_bpf.prog = NULL.

Conditions to recreate the bug:
- CONFIG_NETDEVSIM=y, CONFIG_NET_CLS_BPF=y
- load and pin a dev-bound SCHED_CLS program for netdevsim device B
- install the program on a shared block owned by B
- add an independently backed netdevsim device C to that block; the
bind replays the filter to C's callback, and C's
ports/0/bpf_offloaded_id takes the B-bound program id.

The reported Sashiko review is at
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260809094418.901607-1-jhs@mojatatu.com

Analysis

AI-generated

Technical impact

An installer function in the netdevsim backend accepts classifying BPF programs that are bound to a particular device without ensuring that the program’s offload device matches the target network device. The missing check allows a device‑bound program to be replayed onto a different netdevsim instance. When the replay occurs, the driver’s callback can dereference a NULL program auxiliary field, generating a kernel warning and potentially a crash. This flaw can destabilize the kernel and degrade system availability, and it also fails to enforce the intended per‑device access boundary, weakening isolation in a multi‑device environment.

Affected Systems

The flaw applies to any Linux kernel build that enables netdevsim support (CONFIG_NETDEVSIM=y) together with the BPF traffic‑control classifier (CONFIG_NET_CLS_BPF=y). No specific kernel version range is provided in the advisory, but the patch appears in recent commits to the master branch. Systems that have not applied the latest kernel updates or who retain older kernel images that still compile with these options remain susceptible.

Risk and Exploitability

The absence of a CVSS score and an EPSS rating makes the risk assessment uncertain, but the nature of the fault—an unchecked NULL dereference—implies a high severity potential. The flaw is a kernel‑level issue requiring the delivery of a device‑bound BPF program, which typically requires local write access or a compromised process with the ability to call bpf(). Attack could be achieved via a custom BPF program exploiting the offload device mismatch. The vulnerability is not listed in the CISA KEV catalog, suggesting no confirmed public exploit but the theoretical impact is serious.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that contains the commit adding the offload‑device check for netdevsim BPF programs (for example, apply the patch from the master branch or install a recent distribution kernel that includes the fix).
  • If an upgrade is not immediately possible, disable netdevsim support (CONFIG_NETDEVSIM) or the cls_bpf traffic‑control BPF option (CONFIG_NET_CLS_BPF) to eliminate the affected code path on the system.
  • Avoid deploying device‑bound SCHED_CLS BPF programs on netdevsim devices until the kernel is updated, and ensure that any existing bindings are cleared or re‑compiled against the fixed kernel to prevent replaying into mismatched devices.

Generated by OpenCVE AI on November 30, 2026 at 15:32 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-476
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: netdevsim: reject cls_bpf programs bound to another device The issue: nsim_bpf_setup_tc_block_cb() installs any device-bound SCHED_CLS program without checking that its offload device matches the target netdev. The core cls_bpf attach path rejects a mismatching program, but a netdev that joins a shared block later is replayed the stored filter by cls_bpf_reoffload() before it is inserted into block->ports, so the attach-time check cannot see it. The driver callback is the authoritative per-device acceptance boundary and must enforce the match itself, as nfp already does in nfp_net_bpf_offload(). Without the check, replaying a device-bound program onto a different bpf_offload_dev installs it into that device's netdevsim state, which trips the WARN in nsim_bpf_uninit() (ns->bpf_offloaded set on a foreign device) and can dereference a NULL prog->aux->offload in nsim_prog_set_loaded(). The Fix: Reject a device-bound program whose offload device does not match the target netdev, with -EINVAL and an extack so the rejected replay is not silent. The check is intentionally narrower than nfp's: it fires only for a dev-bound program, so nsim's bpf_tc_non_bound_accept mode (which admits an unbound program onto the device) is unaffected. Teardown is never blocked: the guard is on the program being installed and an unbind passes cls_bpf.prog = NULL. Conditions to recreate the bug: - CONFIG_NETDEVSIM=y, CONFIG_NET_CLS_BPF=y - load and pin a dev-bound SCHED_CLS program for netdevsim device B - install the program on a shared block owned by B - add an independently backed netdevsim device C to that block; the bind replays the filter to C's callback, and C's ports/0/bpf_offloaded_id takes the B-bound program id. The reported Sashiko review is at https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260809094418.901607-1-jhs@mojatatu.com
Title netdevsim: reject cls_bpf programs bound to another device
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:23 PM
Reserved
Sep 25, 2026, 10:25 AM
Status
Received
Published
Nov 30, 2026, 2:17 PM
Modified
Nov 30, 2026, 2:17 PM