bpf: Add bpf_prog_run_data_pointers()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ec624fe740b416fb68d536b37fb8eef46f90b5c2 · < 4ef92743625818932b9c320152b58274c05e5053| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: Add bpf_prog_run_data_pointers()
syzbot found that cls_bpf_classify() is able to change tc_skb_cb(skb)->drop_reason triggering a warning in sk_skb_reason_drop().
WARNING: CPU: 0 PID: 5965 at net/core/skbuff.c:1192 __sk_skb_reason_drop net/core/skbuff.c:1189 [inline] WARNING: CPU: 0 PID: 5965 at net/core/skbuff.c:1192 sk_skb_reason_drop+0x76/0x170 net/core/skbuff.c:1214
struct tc_skb_cb has been added in commit ec624fe740b4 ("net/sched: Extend qdisc control block with tc control block"), which added a wrong interaction with db58ba459202 ("bpf: wire in data and data_end for cls_act_bpf").
drop_reason was added later.
Add bpf_prog_run_data_pointers() helper to save/restore the net_sched storage colliding with BPF data_meta/data_end.
From the CVE record · Linux
In the Linux kernel, cls_bpf_classify() can change a packet's drop_reason because network-scheduling storage overlaps with BPF data pointers. This can trigger a warning when sk_skb_reason_drop() runs. The input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with BPF traffic classification should check their versions; affected versions are not specified.