From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933106AbcH2MwZ (ORCPT ); Mon, 29 Aug 2016 08:52:25 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:38295 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932763AbcH2MwW (ORCPT ); Mon, 29 Aug 2016 08:52:22 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: David Miller Cc: dmitry.torokhov@gmail.com, tj@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <1471386795-32918-1-git-send-email-dmitry.torokhov@gmail.com> <20160819.165917.2302741905893802825.davem@davemloft.net> Date: Mon, 29 Aug 2016 07:38:55 -0500 In-Reply-To: <20160819.165917.2302741905893802825.davem@davemloft.net> (David Miller's message of "Fri, 19 Aug 2016 16:59:17 -0700 (PDT)") Message-ID: <87zinvpx5s.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1beM2w-0004SY-Fd;;;mid=<87zinvpx5s.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=97.119.97.64;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+kN4TSNXOy42vWPR+g4aFYF6C8iL1DpVI= X-SA-Exim-Connect-IP: 97.119.97.64 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 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.4434] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;David Miller X-Spam-Relay-Country: X-Spam-Timing: total 666 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.1 (0.5%), b_tie_ro: 2.2 (0.3%), parse: 0.96 (0.1%), extract_message_metadata: 17 (2.6%), get_uri_detail_list: 1.96 (0.3%), tests_pri_-1000: 4.6 (0.7%), tests_pri_-950: 1.15 (0.2%), tests_pri_-900: 1.01 (0.2%), tests_pri_-400: 20 (2.9%), check_bayes: 19 (2.8%), b_tokenize: 4.9 (0.7%), b_tok_get_all: 7 (1.0%), b_comp_prob: 1.96 (0.3%), b_tok_touch_all: 2.8 (0.4%), b_finish: 0.66 (0.1%), tests_pri_0: 383 (57.5%), check_dkim_signature: 0.44 (0.1%), check_dkim_adsp: 22 (3.2%), tests_pri_500: 232 (34.9%), poll_dns_idle: 227 (34.1%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 0/5] Make /sys/class/net per net namespace objects belong to container 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Miller writes: > From: Dmitry Torokhov > Date: Tue, 16 Aug 2016 15:33:10 -0700 > >> There are objects in /sys hierarchy (/sys/class/net/) that logically belong >> to a namespace/container. Unfortunately all sysfs objects start their life >> belonging to global root, and while we could change ownership manually, >> keeping tracks of all objects that come and go is cumbersome. It would >> be better if kernel created them using correct uid/gid from the beginning. >> >> This series changes kernfs to allow creating object's with arbitrary >> uid/gid, adds get_ownership() callback to ktype structure so subsystems >> could supply their own logic (likely tied to namespace support) for >> determining ownership of kobjects, and adjusts sysfs code to make use of >> this information. Lastly net-sysfs is adjusted to make sure that objects in >> net namespace are owned by the root user from the owning user namespace. >> >> Note that we do not adjust ownership of objects moved into a new namespace >> (as when moving a network device into a container) as userspace can easily >> do it. > > I need some domain experts to review this series please. I just came back from vacation and I will aim to take a look shortly. The big picture idea seems sensible. Having a better ownship of sysfs files that are part of a network namespace. I will have to look at the details to see if the implementation is similarly sensible. Eric