net/sched: cls_u32: skip hash tables in u32_bind_class()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 07d79fc7d94e3f884b8b1c95aa615b202bb5e4c1 · < 31f26a95eeee926946809ac456c61a3217936a62| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/sched: cls_u32: skip hash tables in u32_bind_class()
u32_walk() enumerates both struct tc_u_hnode and struct tc_u_knode through the walker callback. u32_bind_class() unconditionally casts the passed fh to tc_u_knode and accesses &n->res, so when fh is actually a tc_u_hnode, which has no tcf_result member, this results in a slab-out-of-bounds read of res->classid in tc_cls_bind_class().
The issue can be reproduced with the following commands:
tc qdisc add dev lo root handle 1: hfsc tc class add dev lo parent 1: classid 1:1 hfsc sc rate 1000kbit tc filter add dev lo parent 1:1 protocol ip prio 1 u32 match u32 0 0 flowid 1:1 tc class add dev lo parent 1: classid 1:2 hfsc sc rate 2000kbit
Fix this by skipping hash tables via the TC_U32_KEY(handle) check.
From the CVE record · Linux
The Linux kernel's cls_u32 traffic-control code can read beyond a slab allocation when binding a class to a u32 hash table. The issue can be reproduced locally with tc commands that configure traffic control; the input does not specify authentication requirements.
Engineers running Linux kernels with the cls_u32 traffic-control code should check their kernel; affected versions were not provided.