Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp612714ybf; Fri, 28 Feb 2020 04:27:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzx7zppq+mnUW31TXGTRhw4SMAw3iJG2cjiELkXhfBNFC/vbw3WM1Knlxb9HscmoJSyF0M1 X-Received: by 2002:a05:6808:aba:: with SMTP id r26mr2834777oij.4.1582892855025; Fri, 28 Feb 2020 04:27:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582892855; cv=none; d=google.com; s=arc-20160816; b=ieilWHKJtseHWPzwjMz1ilecfzglF0im4+HRroAKlX21nf4VI55AzH8WsDR8tO5hl9 ywmcYrJBVnU6jGUybuA9ukk2eIA+F6py6gLJfw8zzFrdE5OM3iuxqI8zXhk+vwzWAX5a gHcImeYv1zXC2qjHBCZda8Jk+9Ec66nwLx1hV6Sy39+ZiTSDsw0oMAqZF0m5oeug7ZJh 8M+nxshK3E187+eJBajcW+xfZ1cHkupiLdlQUYq+9vqmOICGnFukKOfJc4XnFUUr+wct oCmY5niECyMnMCtzbDBOehabjCAk5lD8EbvFUwr0QUDn4+TEVAATeIgtNr78Hz41aR1K 6V+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=v9QYiG8FJ7Qa1ta0TCvuuIp052RLHbUpKBlNFRRoPXI=; b=u0JfzaKnEQTMzD/SIVA6cffCq0kr07Anl7SJny1U2fG0EYd39ojfawxedejFBYizFK uZUYZtQtFEc3fQ4v10LvlByzFazNcpEssYyuHQz1DS3+mknA+MB4idixLfF4G7WNgYW9 iPwQ6dPLiXMKdTLomqMmF0idkxqy+U9ufzl6rmwD21L8Ujk/JLl7PgXgni74K2K934BP CRkZzqqRdG5V6Rlu7WFpPjpD7JMpoKhEKWkWcikIx5nI08fdi3CjKbyZluQMiRt8j7FU 2BFQzMu0XrntJZDD1JxMC0+Ib1/rks3BYnkctYaoZkK0Xex3F4Hv1YPoKQjH8uX8HKm/ yo3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1qkwABoJ; 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 d24si1322172otq.202.2020.02.28.04.27.22; Fri, 28 Feb 2020 04:27:34 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=1qkwABoJ; 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 S1725906AbgB1M1R (ORCPT + 99 others); Fri, 28 Feb 2020 07:27:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:48882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgB1M1R (ORCPT ); Fri, 28 Feb 2020 07:27:17 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1632D246A3; Fri, 28 Feb 2020 12:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582892834; bh=m93yM93vQbcHMkGCkK/OGG8kf11IbeXU6ORroxAAGzo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1qkwABoJTSe5SmM+7+hNubXHM41yKugx1YRFHDmMnoOK5YYsRXnCmI+7Quf+GWlwi Bsu0HcZJviHZoYaZPpZHFb/vRkds/rPDV/VIY8AovPBUoT3uvbuxw3yFlFhMyyAs6G ZzL4KOs+fv5qzsr28SX0dPrQDm2L4JnAnSNwmRAM= Date: Fri, 28 Feb 2020 13:27:12 +0100 From: Greg Kroah-Hartman To: Miklos Szeredi Cc: Ian Kent , Karel Zak , Miklos Szeredi , James Bottomley , Steven Whitehouse , David Howells , viro , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml , Lennart Poettering , Zbigniew =?utf-8?Q?J=C4=99drzejewski-Szmek?= , util-linux@vger.kernel.org Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] Message-ID: <20200228122712.GA3013026@kroah.com> References: <1582644535.3361.8.camel@HansenPartnership.com> <1c8db4e2b707f958316941d8edd2073ee7e7b22c.camel@themaw.net> <3e656465c427487e4ea14151b77d391d52cd6bad.camel@themaw.net> <20200227151421.3u74ijhqt6ekbiss@ws.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 28, 2020 at 09:35:17AM +0100, Miklos Szeredi wrote: > On Fri, Feb 28, 2020 at 1:43 AM Ian Kent wrote: > > > > I'm not sure about sysfs/, you need somehow resolve namespaces, order > > > of the mount entries (which one is the last one), etc. IMHO translate > > > mountpoint path to sysfs/ path will be complicated. > > > > I wonder about that too, after all sysfs contains a tree of nodes > > from which the view is created unlike proc which translates kernel > > information directly based on what the process should see. > > > > We'll need to wait a bit and see what Miklos has in mind for mount > > table enumeration and nothing has been said about name spaces yet. > > Adding Greg for sysfs knowledge. > > As far as I understand the sysfs model is, basically: > > - list of devices sorted by class and address > - with each class having a given set of attributes Close enough :) > Superblocks and mounts could get enumerated by a unique identifier. > mnt_id seems to be good for mounts, s_dev may or may not be good for > superblock, but s_id (as introduced in this patchset) could be used > instead. So what would the sysfs tree look like with this? > As for namespaces, that's "just" an access control issue, AFAICS. > For example a task with a non-initial mount namespace should not have > access to attributes of mounts outside of its namespace. Checking > access to superblock attributes would be similar: scan the list of > mounts and only allow access if at least one mount would get access. sysfs does handle namespaces, look at how networking does this. But, it's not exactly the simplest thing to do so, so be careful with that as this is going to be essential for this type of work. thanks, greg k-h