From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755944AbcHSX7T (ORCPT ); Fri, 19 Aug 2016 19:59:19 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:55923 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755489AbcHSX7S (ORCPT ); Fri, 19 Aug 2016 19:59:18 -0400 Date: Fri, 19 Aug 2016 16:59:17 -0700 (PDT) Message-Id: <20160819.165917.2302741905893802825.davem@davemloft.net> To: dmitry.torokhov@gmail.com Cc: tj@kernel.org, ebiederm@xmission.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 0/5] Make /sys/class/net per net namespace objects belong to container From: David Miller In-Reply-To: <1471386795-32918-1-git-send-email-dmitry.torokhov@gmail.com> References: <1471386795-32918-1-git-send-email-dmitry.torokhov@gmail.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 19 Aug 2016 16:59:17 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thank you.