CVE-2026-74382: net/sched: cls_bpf: prevent unbounded recursion in offload rollback
In the Linux kernel, the following vulnerability has been resolved:
net/sched: clsbpf: prevent unbounded recursion in offload rollback
Quan Sun reported [1] a stack overflow in clsbpfoffloadcmd().
Reproducer on netdevsim: add a skipsw clsbpf filter, set the bpftcaccept debugfs knob to 0, then tc filter replace. The replace calls tcsetupcbreplace() which fails. clsbpfoffloadcmd() then swaps prog/oldprog and recursively calls itself to roll back. But bpftcaccept=0 makes the rollback fail too, which triggers yet another rollback frame with the same arguments, and so on until the stack is exhausted.
bpftcaccept is just a convenient knob for the reproducer. Any driver whose tcsetupcbreplace() fails twice in a row can hit the same loop, so this is not a netdevsim-only issue.
Two ways to fix it:
1) Have the rollback call tcsetupcbadd() on oldprog instead of re-entering clsbpfoffloadcmd(). 2) Mark the rollback frame with a flag and skip a second-level rollback from inside it.
Go with (2). It is the smaller change and keeps the original behaviour: the rollback still goes through tcsetupcbreplace(), so the driver gets one real chance to restore its state. If that attempt also fails, we just return the original error instead of recursing.
[1]: https://lore.kernel.org/bpf/ce5a6005-3c5e-4696-9e05-eba9461dc860@std.uestc.edu.cn/T/#u
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel (net/sched: cls_bpf)to a version that resolves this vulnerability.Patch net/sched: cls_bpf: prevent unbounded recursion in offload rollback - Configuration
Set the bpf_tc_accept debugfs knob to 0 (for the cls_bpf_offload_cmd()/offload rollback reproducer), then run `tc filter replace` to ensure the rollback attempts don’t re-trigger the infinite recursion during testing.
Linux kernel (net/sched cls_bpf) debugfs knob bpf_tc_accept bpf_tc_accept = 0
Event History
Frequently Asked Questions
What is the severity of CVE-2026-74382?
CVE-2026-74382 has a risk rating of 53, indicating a moderate level of severity.
How do I fix CVE-2026-74382?
To mitigate CVE-2026-74382, ensure your Linux kernel is updated to the latest version that includes the security patch.
What does CVE-2026-74382 affect?
CVE-2026-74382 affects the Linux kernel's networking subsystem, specifically the cls_bpf component.
What is the nature of the vulnerability in CVE-2026-74382?
CVE-2026-74382 involves a stack overflow caused by unbounded recursion in the cls_bpf_offload_cmd() function.
Who reported the CVE-2026-74382 vulnerability?
CVE-2026-74382 was reported by researcher Quan Sun.