All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Elad Raz <e@eladraz.com>, Paul Moore <paul@paul-moore.com>,
	Richard Guy Briggs <rgb@redhat.com>
Subject: Re: [Patch net] net: saving irq context for peernet2id()
Date: Thu, 20 Oct 2016 11:29:11 -0700	[thread overview]
Message-ID: <CAM_iQpWD3WiX1ZX+3LJ8vbJc42K1jZcZ4-f6MO5kzZY-+Szkqw@mail.gmail.com> (raw)
In-Reply-To: <2707c52d-88ec-7b93-f96e-eeaffc952c9c@tycho.nsa.gov>

On Thu, Oct 20, 2016 at 7:58 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On 10/20/2016 02:52 AM, Cong Wang wrote:
>> 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.
>
> Not sure this suffices; kill_fasync() -> send_sigio() ->
> send_sigio_to_task() -> sigio_perm() -> security_file_send_sigiotask()
> -> selinux_file_send_sigiotask() -> ... -> audit_log() -> ... ->
> peernet2id()

Oh, this is a new one. kill_fasync() is called in IRQ handler, so we actually
do multicast in IRQ context.... It makes no sense, netlink multicast could
be very expensive if we have many listeners.

I am Cc'ing Richard who added that multicast in audit_log_end(). It seems
not easy to just move the multicast to a workqueue, since the skb is copied
from audit_buffer which is freed immediately after that, probably need another
queue like audit_skb_queue.

  reply	other threads:[~2016-10-20 18:29 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
2016-10-20 17:17   ` Cong Wang
2016-10-20 14:58 ` Stephen Smalley
2016-10-20 18:29   ` Cong Wang [this message]
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=CAM_iQpWD3WiX1ZX+3LJ8vbJc42K1jZcZ4-f6MO5kzZY-+Szkqw@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=e@eladraz.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=rgb@redhat.com \
    --cc=sds@tycho.nsa.gov \
    /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.