https://github.com/torvalds/linux
Revision d7aa04a5e82b4f254d306926c81eae8df69e5200 authored by Roman Kapl on 20 November 2017, 21:21:13 UTC, committed by David S. Miller on 23 November 2017, 16:25:37 UTC
If you flush (delete) a filter chain other than chain 0 (such as when
deleting the device), the kernel may run into a use-after-free. The
chain refcount must not be decremented unless we are sure we are done
with the chain.

To reproduce the bug, run:
    ip link add dtest type dummy
    tc qdisc add dev dtest ingress
    tc filter add dev dtest chain 1  parent ffff: flower
    ip link del dtest

Introduced in: commit f93e1cdcf42c ("net/sched: fix filter flushing"),
but unless you have KAsan or luck, you won't notice it until
commit 0dadc117ac8b ("cls_flower: use tcf_exts_get_net() before call_rcu()")

Fixes: f93e1cdcf42c ("net/sched: fix filter flushing")
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Roman Kapl <code@rkapl.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0cc0350
History
Tip revision: d7aa04a5e82b4f254d306926c81eae8df69e5200 authored by Roman Kapl on 20 November 2017, 21:21:13 UTC
net: sched: fix crash when deleting secondary chains
Tip revision: d7aa04a
File Mode Size
6lowpan
Kconfig -rw-r--r-- 986 bytes
Makefile -rw-r--r-- 331 bytes
core.c -rw-r--r-- 8.8 KB
core.h -rw-r--r-- 1.3 KB
header_ops.c -rw-r--r-- 6.8 KB
ieee802154.h -rw-r--r-- 3.4 KB
netlink.c -rw-r--r-- 4.6 KB
nl-mac.c -rw-r--r-- 34.7 KB
nl-phy.c -rw-r--r-- 8.0 KB
nl802154.c -rw-r--r-- 66.8 KB
nl802154.h -rw-r--r-- 193 bytes
nl_policy.c -rw-r--r-- 3.3 KB
rdev-ops.h -rw-r--r-- 8.8 KB
socket.c -rw-r--r-- 23.4 KB
sysfs.c -rw-r--r-- 2.6 KB
sysfs.h -rw-r--r-- 233 bytes
trace.c -rw-r--r-- 102 bytes
trace.h -rw-r--r-- 8.2 KB

back to top