mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Michael J. Coss" <michael.coss@alcatel-lucent.com>
Cc: gregkh@linuxfoundation.org, davem@davemloft.net,
	linux-kernel@vger.kernel.org,
	containers@lists.linuxcontainers.org, serge.hallyn@ubuntu.com,
	stgraber@ubuntu.com
Subject: Re: [PATCH 1/3] lib/kobject_uevent.c: disable broadcast of uevents to other namespaces
Date: Thu, 10 Sep 2015 19:36:04 -0500	[thread overview]
Message-ID: <87zj0tyeq3.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <51c185b6fa89f0b8e9e7dcaffb3c21c975c84302.1441762578.git.michael.coss@alcatel-lucent.com> (Michael J. Coss's message of "Tue, 8 Sep 2015 22:10:28 -0400")

"Michael J. Coss" <michael.coss@alcatel-lucent.com> writes:

> Restrict sending uevents to only those listeners operating in the same
> network namespace as the system init process.  This is the first step
> toward allowing policy control of the forwarding of events to other
> namespaces in userspace.

This limitation whould be better if we only skipped network namespaces
where you are sending spoofed uevents.

As it sits this has the possibility to break userspace.

Eric

> Signed-off-by: Michael J. Coss <michael.coss@alcatel-lucent.com>
> ---
>  lib/kobject_uevent.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
> index f6c2c1e..d791e33 100644
> --- a/lib/kobject_uevent.c
> +++ b/lib/kobject_uevent.c
> @@ -295,6 +295,10 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
>  		if (!netlink_has_listeners(uevent_sock, 1))
>  			continue;
>  
> +		/* forward event only to the host systems network namespaces */
> +		if (!net_eq(sock_net(uevent_sock), &init_net))
> +			continue;
> +
>  		/* allocate message with the maximum possible size */
>  		len = strlen(action_string) + strlen(devpath) + 2;
>  		skb = alloc_skb(len + env->buflen, GFP_KERNEL);

  reply	other threads:[~2015-09-11  0:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09  2:10 [PATCH 0/3] kobject: support namespace aware udev Michael J. Coss
2015-09-09  2:10 ` [PATCH 1/3] lib/kobject_uevent.c: disable broadcast of uevents to other namespaces Michael J. Coss
2015-09-11  0:36   ` Eric W. Biederman [this message]
2015-09-11 18:21     ` Michael J Coss
2015-09-09  2:10 ` [PATCH 2/3] lib/kobject_uevent.c: add uevent forwarding function Michael J. Coss
2015-09-09  3:55   ` Greg KH
2015-09-09 19:24     ` Michael J Coss
2015-09-09 20:11       ` Greg KH
2015-09-10  5:43         ` Amir Goldstein
2015-09-10  5:58           ` Greg KH
2015-09-11  0:54   ` Eric W. Biederman
2015-09-11 18:43     ` [COMMERCIAL] " Michael J Coss
2015-09-09  2:10 ` [PATCH 3/3] net/udevns: Netlink module to forward uevent to containers Michael J. Coss
2015-09-11  1:05   ` Eric W. Biederman
2015-09-11 19:01     ` Michael J Coss
2015-09-09  3:54 ` [PATCH 0/3] kobject: support namespace aware udev Greg KH
2015-09-09 19:05   ` Michael J Coss
2015-09-09 20:09     ` Greg KH
2015-09-09 20:16       ` Michael J Coss
2015-09-09 20:28         ` Greg KH
2015-09-09 20:55           ` [COMMERCIAL] " Michael J Coss
2015-09-10  5:21             ` Greg KH

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=87zj0tyeq3.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=containers@lists.linuxcontainers.org \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.coss@alcatel-lucent.com \
    --cc=serge.hallyn@ubuntu.com \
    --cc=stgraber@ubuntu.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

Powered by JetHome