All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Linux Kernel Network Developers <netdev@vger.kernel.org>
Cc: Lucas Bates <lucasb@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>
Subject: Re: [Patch net 2/2] net_sched: hold netns refcnt for each action
Date: Fri, 3 Nov 2017 18:15:27 -0700	[thread overview]
Message-ID: <CAM_iQpV=2dKPqGmCUD5W3Ekd600E0+h39e_y2PTgwKW1xG-+WQ@mail.gmail.com> (raw)
In-Reply-To: <20171101172350.12842-3-xiyou.wangcong@gmail.com>

On Wed, Nov 1, 2017 at 10:23 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> TC actions have been destroyed asynchronously for a long time,
> previously in a RCU callback and now in a workqueue. If we
> don't hold a refcnt for its netns, we could use the per netns
> data structure, struct tcf_idrinfo, after it has been freed by
> netns workqueue.
>
> Hold refcnt to ensure netns destroy happens after all actions
> are gone.

This in fact is wrong. If we hold that refcnt, the netns can never
be destroyed until all actions are destroyed by user, this breaks
our netns design.

I am going to send a revert and a right way to fix it. It is more
complicated that I thought due to all of these flying RCU callbacks
and workqueue again, sigh...

Sorry about it.

  reply	other threads:[~2017-11-04  1:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 17:23 [Patch net 0/2] net_sched: fix a use-after-free for tc actions Cong Wang
2017-11-01 17:23 ` [Patch net 1/2] net_sched: acquire RTNL in tc_action_net_exit() Cong Wang
2017-11-01 17:23 ` [Patch net 2/2] net_sched: hold netns refcnt for each action Cong Wang
2017-11-04  1:15   ` Cong Wang [this message]
2017-11-03  1:30 ` [Patch net 0/2] net_sched: fix a use-after-free for tc actions 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_iQpV=2dKPqGmCUD5W3Ekd600E0+h39e_y2PTgwKW1xG-+WQ@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=lucasb@mojatatu.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.