netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>, Li Shuang <shuali@redhat.com>,
	Ivan Vecera <ivecera@redhat.com>
Subject: Re: [PATCH net v4] cls_u32: fix use after free in u32_destroy_key()
Date: Mon, 5 Feb 2018 13:37:54 -0800	[thread overview]
Message-ID: <CAM_iQpUTR3+of29EGyoJg3ty+z9NEZ2WrmrHmcXtOfjkhVmmzw@mail.gmail.com> (raw)
In-Reply-To: <096ddb46db4fcb134ee7ccaf8de74397ef84e1ec.1517865640.git.pabeni@redhat.com>

On Mon, Feb 5, 2018 at 1:23 PM, Paolo Abeni <pabeni@redhat.com> wrote:
> The problem is that the htnode is freed before the linked knodes and the
> latter will try to access the first at u32_destroy_key() time.
> This change addresses the issue using the htnode refcnt to guarantee
> the correct free order. While at it also add a RCU annotation,
> to keep sparse happy.
>
> v1 -> v2: use rtnl_derefence() instead of RCU read locks
> v2 -> v3:
>   - don't check refcnt in u32_destroy_hnode()
>   - cleaned-up u32_destroy() implementation
>   - cleaned-up code comment
> v3 -> v4:
>   - dropped unneeded comment
>
> Reported-by: Li Shuang <shuali@redhat.com>
> Fixes: c0d378ef1266 ("net_sched: use tcf_queue_work() in u32 filter")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks.

  reply	other threads:[~2018-02-05 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 21:23 [PATCH net v4] cls_u32: fix use after free in u32_destroy_key() Paolo Abeni
2018-02-05 21:37 ` Cong Wang [this message]
2018-02-06 16:32 ` David Miller

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=CAM_iQpUTR3+of29EGyoJg3ty+z9NEZ2WrmrHmcXtOfjkhVmmzw@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=ivecera@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuali@redhat.com \
    /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).