Received: by 10.192.165.148 with SMTP id m20csp3939793imm; Mon, 30 Apr 2018 08:56:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqZaI4gKA7pBCL6VAjh1bYa0q4eHsDLSGrf/S6YYMrpgo939lC/JqPgbGqdGPqxLHxhvJFe X-Received: by 2002:a63:5f4c:: with SMTP id t73-v6mr10522934pgb.226.1525103818341; Mon, 30 Apr 2018 08:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525103818; cv=none; d=google.com; s=arc-20160816; b=uZFCFZZb+M4vUuLHRDzhpVkHkRs8EB/GKZof219C94PP0x0AGW14Z+o8kt4NbNxymK 4cVsNGB3zd2dfdOGCv4OPN29kPfRbUBU8/nNb5sr8fVN5dGPCRT3h80CoKyVfg3mXZsx lCXPVXwK5dSEqW88K0AeyJZZA5NRla0vfIdRF9LA+jhEkGBtLk+uOPaTaLvX9fH8uuO1 Dltjjk8MByh8IdW49y9DDbiN6xh89ajCPkOYSzbJkCCD3FzvIHGoTLx3tmOS2q4HHqsC Tkur5sPScTO8V8Vin0/5Zv6Od+y10ek+e5zZCI/Lx4R0nII5CE7pTguIAoJLTzPqm97C h35w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=19b4SvwfPYgohKmYh1/InBRNHrhNiW7l89EnDSMPXU8=; b=NVZ2w3+W63l/hW8KWE7tivhYTBm8r7t02fUVLrU1wAKt3MeUrE8NLP+eqexdSzdlMe 3tmzP5szuhxIIxnpCkI6K/Ek1djKylyFXOuNgenPdDonyIckYwRv0rb8lbV09Fo4hkTz axBXk5y6AlZRwfjJXotXydy8e9al8rcz/1f4Tc7OEzZPYmh3QQagAI8KVtmgxC+dA6Vx HlBbotAJ4zftLCYs1RMWfWHgGu1fUSdVOU7xhgBJEEi16KwbiG0uwP82jUlDKrftcobT KTgNtrA4B0SlAkfmQWPDlAsLk8qGrsAQZ7u6cjoLQLZ+p583ggVFzqCQXJSocYciviQa oK1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12-v6si6411274pgs.164.2018.04.30.08.56.43; Mon, 30 Apr 2018 08:56:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754779AbeD3P4T (ORCPT + 99 others); Mon, 30 Apr 2018 11:56:19 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:57077 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754500AbeD3P4R (ORCPT ); Mon, 30 Apr 2018 11:56:17 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fDB9z-0003x7-ND; Mon, 30 Apr 2018 09:56:15 -0600 Received: from [97.119.174.25] (helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fDB9k-0001RM-BY; Mon, 30 Apr 2018 09:56:15 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Christian Brauner Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, avagin@virtuozzo.com, ktkhai@virtuozzo.com, serge@hallyn.com, gregkh@linuxfoundation.org References: <20180429104412.22445-1-christian.brauner@ubuntu.com> Date: Mon, 30 Apr 2018 10:55:55 -0500 In-Reply-To: <20180429104412.22445-1-christian.brauner@ubuntu.com> (Christian Brauner's message of "Sun, 29 Apr 2018 12:44:10 +0200") Message-ID: <87fu3cbsdw.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1fDB9k-0001RM-BY;;;mid=<87fu3cbsdw.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19VcS1Rh26zKMPlNfhAVavSCYK/i7rglDU= X-SA-Exim-Connect-IP: 97.119.174.25 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa07.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.1 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,XMSolicitRefs_0 autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4601] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.1 XMSolicitRefs_0 Weightloss drug X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Christian Brauner X-Spam-Relay-Country: X-Spam-Timing: total 15028 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.8 (0.0%), b_tie_ro: 1.87 (0.0%), parse: 0.73 (0.0%), extract_message_metadata: 15 (0.1%), get_uri_detail_list: 1.96 (0.0%), tests_pri_-1000: 2.9 (0.0%), tests_pri_-950: 1.15 (0.0%), tests_pri_-900: 1.03 (0.0%), tests_pri_-400: 21 (0.1%), check_bayes: 20 (0.1%), b_tokenize: 7 (0.0%), b_tok_get_all: 6 (0.0%), b_comp_prob: 1.95 (0.0%), b_tok_touch_all: 2.8 (0.0%), b_finish: 0.72 (0.0%), tests_pri_0: 185 (1.2%), check_dkim_signature: 0.48 (0.0%), check_dkim_adsp: 8 (0.1%), tests_pri_500: 14795 (98.5%), poll_dns_idle: 14784 (98.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH net-next 0/2 v5] netns: uevent filtering X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christian Brauner writes: > Hey everyone, > > This is the new approach to uevent filtering as discussed (see the > threads in [1], [2], and [3]). It only contains *non-functional > changes*. > > This series deals with with fixing up uevent filtering logic: > - uevent filtering logic is simplified > - locking time on uevent_sock_list is minimized > - tagged and untagged kobjects are handled in separate codepaths > - permissions for userspace are fixed for network device uevents in > network namespaces owned by non-initial user namespaces > Udev is now able to see those events correctly which it wasn't before. > For example, moving a physical device into a network namespace not > owned by the initial user namespaces before gave: > > root@xen1:~# udevadm --debug monitor -k > calling: monitor > monitor will print the received events for: > KERNEL - the kernel uevent > > sender uid=65534, message ignored > sender uid=65534, message ignored > sender uid=65534, message ignored > sender uid=65534, message ignored > sender uid=65534, message ignored > > and now after the discussion and solution in [3] correctly gives: > > root@xen1:~# udevadm --debug monitor -k > calling: monitor > monitor will print the received events for: > KERNEL - the kernel uevent > > KERNEL[625.301042] add /devices/pci0000:00/0000:00:02.0/0000:01:00.1/net/enp1s0f1 (net) > KERNEL[625.301109] move /devices/pci0000:00/0000:00:02.0/0000:01:00.1/net/enp1s0f1 (net) > KERNEL[625.301138] move /devices/pci0000:00/0000:00:02.0/0000:01:00.1/net/eth1 (net) > KERNEL[655.333272] remove /devices/pci0000:00/0000:00:02.0/0000:01:00.1/net/eth1 (net) > > Thanks! > Christian > > [1]: https://lkml.org/lkml/2018/4/4/739 > [2]: https://lkml.org/lkml/2018/4/26/767 > [3]: https://lkml.org/lkml/2018/4/26/738 Acked-by: "Eric W. Biederman" > > Christian Brauner (2): > uevent: add alloc_uevent_skb() helper > netns: restrict uevents > > lib/kobject_uevent.c | 178 ++++++++++++++++++++++++++++++------------- > 1 file changed, 126 insertions(+), 52 deletions(-) Eric