[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpX3qVVtzJDe-d8NGnC32-BFjiO6UX6+tk_Lco1owr=hhg@mail.gmail.com>
Date: Mon, 20 Nov 2017 11:16:15 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Roman Kapl <code@...pl.cz>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Jiri Pirko <jiri@...nulli.us>
Subject: Re: [PATCH v2] net: sched: fix crash when deleting secondary chains
On Sun, Nov 19, 2017 at 9:36 AM, Roman Kapl <code@...pl.cz> wrote:
> 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@...lanox.com>
> Signed-off-by: Roman Kapl <code@...pl.cz>
Acked-by: Cong Wang <xiyou.wangcong@...il.com>
Powered by blists - more mailing lists