netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: code@rkapl.cz
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v2] net: sched: fix crash when deleting secondary chains
Date: Fri, 24 Nov 2017 01:27:16 +0900 (KST)	[thread overview]
Message-ID: <20171124.012716.1134458426501486126.davem@davemloft.net> (raw)
In-Reply-To: <20171119173632.13125-1-code@rkapl.cz>

From: Roman Kapl <code@rkapl.cz>
Date: Mon, 20 Nov 2017 22:21:13 +0100

> 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>

Applied, thank you.

      parent reply	other threads:[~2017-11-23 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 21:21 [PATCH v2] net: sched: fix crash when deleting secondary chains Roman Kapl
2017-11-20 19:16 ` Cong Wang
2017-11-23 16:27 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171124.012716.1134458426501486126.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=code@rkapl.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).