All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Cc: sds@tycho.nsa.gov, e@eladraz.com, paul@paul-moore.com
Subject: Re: [Patch net] net: saving irq context for peernet2id()
Date: Thu, 20 Oct 2016 12:17:18 +0200	[thread overview]
Message-ID: <eced0989-d8bc-d34e-9ecb-8540d80a7173@6wind.com> (raw)
In-Reply-To: <1476946352-15770-1-git-send-email-xiyou.wangcong@gmail.com>

Le 20/10/2016 à 08:52, Cong Wang a écrit :
> A kernel warning inside __local_bh_enable_ip() was reported by people
> running SELinux, this is caused due to some SELinux functions
> (indirectly) call peernet2id() with IRQ disabled in process context,
> when we re-enable BH with IRQ disabled kernel complains. Shut up this
> warning by saving IRQ context in peernet2id(), BH is still implicitly
> disabled.

Franckly, reverting the original patch seems better for me. The intention for
that patch was "it's not needed", see the commit log:

"We never read or change netns id in hardirq context,
the only place we read netns id in softirq context
is in vxlan_xmit(). So, it should be enough to just
disable BH."

Now, we see that "it's needed" and that the analysis was wrong. If a race is
introduced by this patch, it will be hard to detect and fix it.


Regards,
Nicolas

  reply	other threads:[~2016-10-20 10:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  6:52 [Patch net] net: saving irq context for peernet2id() Cong Wang
2016-10-20 10:17 ` Nicolas Dichtel [this message]
2016-10-20 17:17   ` Cong Wang
2016-10-20 14:58 ` Stephen Smalley
2016-10-20 18:29   ` Cong Wang
2016-10-20 19:04     ` Cong Wang
2016-10-20 19:07     ` Paul Moore
2016-10-20 23:35       ` Cong Wang
2016-10-21  4:47         ` Cong Wang
2016-10-21 13:51           ` Stephen Smalley
2016-10-21 16:19         ` Paul Moore
2016-10-21 18:02           ` Cong Wang
2016-10-21 19:39             ` Richard Guy Briggs
2016-10-21 20:15               ` Paul Moore
2016-10-21 20:33                 ` David Miller
2016-10-21 20:53                   ` Paul Moore
2016-10-22  1:55                     ` Paul Moore
2016-10-22  3:34                       ` Cong Wang
2016-10-22  3:53                   ` Cong Wang
2016-10-21 20:03             ` Paul Moore
2016-10-22  3:26               ` Cong Wang
2016-10-22 19:02                 ` Paul Moore

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=eced0989-d8bc-d34e-9ecb-8540d80a7173@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=e@eladraz.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --cc=xiyou.wangcong@gmail.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 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.