mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-13 07:31:07 +00:00
net: sched: fix crash when deleting secondary chains
commitd7aa04a5e8upstream. 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: commitf93e1cdcf4("net/sched: fix filter flushing"), but unless you have KAsan or luck, you won't notice it until commit0dadc117ac("cls_flower: use tcf_exts_get_net() before call_rcu()") Fixes:f93e1cdcf4("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> Cc: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bc44a1bbd1
commit
b6b42b3d2d
1 changed files with 4 additions and 3 deletions
Loading…
Add table
Add a link
Reference in a new issue