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
Kconfig -rw-r--r-- 2.1 KB
Makefile -rw-r--r-- 691 bytes
af_vsock.c -rw-r--r-- 48.1 KB
af_vsock_tap.c -rw-r--r-- 2.2 KB
diag.c -rw-r--r-- 4.4 KB
hyperv_transport.c -rw-r--r-- 22.4 KB
virtio_transport.c -rw-r--r-- 18.1 KB
virtio_transport_common.c -rw-r--r-- 25.3 KB
vmci_transport.c -rw-r--r-- 58.1 KB
vmci_transport.h -rw-r--r-- 4.1 KB
vmci_transport_notify.c -rw-r--r-- 18.2 KB
vmci_transport_notify.h -rw-r--r-- 2.9 KB
vmci_transport_notify_qstate.c -rw-r--r-- 11.5 KB
vsock_addr.c -rw-r--r-- 1.9 KB

back to top