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
netfilter
Kconfig -rw-r--r-- 1.6 KB
Makefile -rw-r--r-- 305 bytes
README -rw-r--r-- 299 bytes
TODO -rw-r--r-- 1.2 KB
af_decnet.c -rw-r--r-- 53.4 KB
dn_dev.c -rw-r--r-- 32.3 KB
dn_fib.c -rw-r--r-- 18.5 KB
dn_neigh.c -rw-r--r-- 15.9 KB
dn_nsp_in.c -rw-r--r-- 21.0 KB
dn_nsp_out.c -rw-r--r-- 17.2 KB
dn_route.c -rw-r--r-- 47.4 KB
dn_rules.c -rw-r--r-- 5.5 KB
dn_table.c -rw-r--r-- 20.1 KB
dn_timer.c -rw-r--r-- 3.1 KB
sysctl_net_decnet.c -rw-r--r-- 7.2 KB

README

back to top