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
crush
Kconfig -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 428 bytes
armor.c -rw-r--r-- 1.9 KB
auth.c -rw-r--r-- 7.4 KB
auth_none.c -rw-r--r-- 3.1 KB
auth_none.h -rw-r--r-- 503 bytes
auth_x.c -rw-r--r-- 19.7 KB
auth_x.h -rw-r--r-- 1019 bytes
auth_x_protocol.h -rw-r--r-- 1.7 KB
buffer.c -rw-r--r-- 1.2 KB
ceph_common.c -rw-r--r-- 18.7 KB
ceph_fs.c -rw-r--r-- 2.6 KB
ceph_hash.c -rw-r--r-- 2.9 KB
ceph_strings.c -rw-r--r-- 1.2 KB
cls_lock_client.c -rw-r--r-- 10.3 KB
crypto.c -rw-r--r-- 7.9 KB
crypto.h -rw-r--r-- 1.0 KB
debugfs.c -rw-r--r-- 12.7 KB
messenger.c -rw-r--r-- 86.2 KB
mon_client.c -rw-r--r-- 32.6 KB
msgpool.c -rw-r--r-- 2.1 KB
osd_client.c -rw-r--r-- 137.2 KB
osdmap.c -rw-r--r-- 61.5 KB
pagelist.c -rw-r--r-- 3.7 KB
pagevec.c -rw-r--r-- 4.0 KB
snapshot.c -rw-r--r-- 2.2 KB
string_table.c -rw-r--r-- 2.2 KB

back to top