{"id":"CVE-2026-100018","aliases":["CVE-2026-100018"],"related":[],"kind":"vulnerability","state":"published","title":"netdevsim: reject cls_bpf programs bound to another device","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetdevsim: reject cls_bpf programs bound to another device\n\nThe issue:\nnsim_bpf_setup_tc_block_cb() installs any device-bound SCHED_CLS program\nwithout checking that its offload device matches the target netdev.  The\ncore cls_bpf attach path rejects a mismatching program, but a netdev that\njoins a shared block later is replayed the stored filter by\ncls_bpf_reoffload() before it is inserted into block->ports, so the\nattach-time check cannot see it.  The driver callback is the\nauthoritative per-device acceptance boundary and must enforce the match\nitself, as nfp already does in nfp_net_bpf_offload().\n\nWithout the check, replaying a device-bound program onto a different\nbpf_offload_dev installs it into that device's netdevsim state, which\ntrips the WARN in nsim_bpf_uninit() (ns->bpf_offloaded set on a foreign\ndevice) and can dereference a NULL prog->aux->offload in\nnsim_prog_set_loaded().\n\nThe Fix:\nReject a device-bound program whose offload device does not match the\ntarget netdev, with -EINVAL and an extack so the rejected replay is not\nsilent.  The check is intentionally narrower than nfp's: it fires only\nfor a dev-bound program, so nsim's bpf_tc_non_bound_accept mode (which\nadmits an unbound program onto the device) is unaffected.  Teardown is\nnever blocked: the guard is on the program being installed and an unbind\npasses cls_bpf.prog = NULL.\n\nConditions to recreate the bug:\n  - CONFIG_NETDEVSIM=y, CONFIG_NET_CLS_BPF=y\n  - load and pin a dev-bound SCHED_CLS program for netdevsim device B\n  - install the program on a shared block owned by B\n  - add an independently backed netdevsim device C to that block; the\n    bind replays the filter to C's callback, and C's\n    ports/0/bpf_offloaded_id takes the B-bound program id.\n\nThe reported Sashiko review is at\nhttps://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260809094418.901607-1-jhs@mojatatu.com","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetdevsim: reject cls_bpf programs bound to another device\n\nThe issue:\nnsim_bpf_setup_tc_block_cb() installs any device-bound SCHED_CLS program\nwithout checking that its offload device matches the target netdev.  The\ncore cls_bpf attach path rejects a mismatching program, but a netdev that\njoins a shared block later is replayed the stored filter by\ncls_bpf_reoffload() before it is inserted into block->ports, so the\nattach-time check cannot see it.  The driver callback is the\nauthoritative per-device acceptance boundary and must enforce the match\nitself, as nfp already does in nfp_net_bpf_offload().\n\nWithout the check, replaying a device-bound program onto a different\nbpf_offload_dev installs it into that device's netdevsim state, which\ntrips the WARN in nsim_bpf_uninit() (ns->bpf_offloaded set on a foreign\ndevice) and can dereference a NULL prog->aux->offload in\nnsim_prog_set_loaded().\n\nThe Fix:\nReject a device-bound program whose offload device does not match the\ntarget netdev, with -EINVAL and an extack so the rejected replay is not\nsilent.  The check is intentionally narrower than nfp's: it fires only\nfor a dev-bound program, so nsim's bpf_tc_non_bound_accept mode (which\nadmits an unbound program onto the device) is unaffected.  Teardown is\nnever blocked: the guard is on the program being installed and an unbind\npasses cls_bpf.prog = NULL.\n\nConditions to recreate the bug:\n  - CONFIG_NETDEVSIM=y, CONFIG_NET_CLS_BPF=y\n  - load and pin a dev-bound SCHED_CLS program for netdevsim device B\n  - install the program on a shared block owned by B\n  - add an independently backed netdevsim device C to that block; the\n    bind replays the filter to C's callback, and C's\n    ports/0/bpf_offloaded_id takes the B-bound program id.\n\nThe reported Sashiko review is at\nhttps://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260809094418.901607-1-jhs@mojatatu.com","source":"cvelist"}],"published":"2026-11-30T13:23:07.455Z","modified":"2026-11-30T14:17:16.913Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"40a0adc98895d09b42d9bb9f835f6dff2f33c4e3","status":"affected"},{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"dcc30b18a028cce7679cbcbb49c72921f8f5d52a","status":"affected"},{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"349f1e431d03a97e9bd160429fd0fe0a67a063b0","status":"affected"},{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"6f5e04e73f60e122b1a9ff20256a74617f8954dc","status":"affected"},{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"16ec59a2a59a1beda422c24f33bba5b09ac1a36c","status":"affected"},{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"c59b5fcbc7b777bcf89a976af57f52a95ba42b6f","status":"affected"},{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"6b48deba1968a573eba8a26981c8431366779518","status":"affected"},{"type":"git","introduced":"31d3ad832948c75139b0e5b653912f7898a1d5d5","fixed":"5820ca58b409402505b9e904d1ded4908e0b6b81","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.16","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/40a0adc98895d09b42d9bb9f835f6dff2f33c4e3","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/dcc30b18a028cce7679cbcbb49c72921f8f5d52a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/349f1e431d03a97e9bd160429fd0fe0a67a063b0","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6f5e04e73f60e122b1a9ff20256a74617f8954dc","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/16ec59a2a59a1beda422c24f33bba5b09ac1a36c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c59b5fcbc7b777bcf89a976af57f52a95ba42b6f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6b48deba1968a573eba8a26981c8431366779518","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5820ca58b409402505b9e904d1ded4908e0b6b81","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-100018","url":"https://www.cve.org/CVERecord?id=CVE-2026-100018","licence":"CVE Terms of Use","modified":"2026-11-30T13:23:07.455Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-100018","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-100018","licence":"Public domain","modified":"2026-11-30T14:17:16.913Z"}],"updatedAt":"2026-11-30T14:32:19.090Z","epss":{"score":0.00177,"percentile":0.07626,"date":"2026-12-01T12:00:22.000Z"}}