Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp413324rdb; Sat, 17 Feb 2024 14:54:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0BfqTOrXcTDlgUQrTPNl5HQqhEfdX4XY1227e4yM4dfqrF3MSP/4fknxF0ptg1Jj4qu9oXcVzBsezxYXm30cvXG19Qi9fUjSswO+LFQ== X-Google-Smtp-Source: AGHT+IEbLQaXX5G9VPxNsOW48hvfJIHnDZHwfp0DRQtBmsg12z377EfrroL/o0lE+EySziMbozBw X-Received: by 2002:a05:620a:454d:b0:783:bcc9:cd84 with SMTP id u13-20020a05620a454d00b00783bcc9cd84mr13470215qkp.49.1708210476347; Sat, 17 Feb 2024 14:54:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708210476; cv=pass; d=google.com; s=arc-20160816; b=b9jhRFlDZiNZHADbVVyGnxcAUo9f/w/OsV9wGRwRYlMtid8TxhVsWScAovmqrXXpEu M6COAlNmoEQYtMDzXkyt4FC0zrRkM2arA0XA9dfhyhzjjgWSNUB71rmjgWUwSyLtiv51 9a+mNz0qk0HiszXQubTzwwG5iXOe359RoGWicaOrnyipd0r6xqX06g9cUqrQENRW8Yw6 VfyGsE7Ru/DECq7Fumim557ff3OGQauYto6IYqC5BTrA7BKW3FXp6QTHGPRUyWbLciO5 PLMgv27zoRKwYrNuqgzOwiyAM6g5Db2CdtqYYmfv9DGqYM2WolSfclzsduCdydlLn0G4 f0/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=J+S6PW8NMbxHlN/D+9fN8tZavb8MoLjIhahjYs7L4uw=; fh=gfp0rrBc+lLKnmAdWMZvQDsS/1ONHtdxz+XCc4tcKTc=; b=Jtd/xQj7qtzVfNFYfb5Ga7onqR889rgfyehyopChZGgCDJNie2XLhcvaY/ntHVhlds YpEUizIhGbk/lOmVyFuuqW8ZaXYVU9iZXqrb/ceFpRneRb9LJouSAoQQIjvW8kX6aznZ w7u+qiypVbNe3p1dIOGjekR5AJVWeAW3aA6/gqmClBRsUGwchDF3t8nV33N9vTWkAKb8 TEY27m2qJkSO5XpGemIb2mowYDStcEGK4CJD6YZmMQVfPwGnfIQkk6wqS57Sn5mfFP21 b4zXZ3F1a1gGmGlzAbOAwZMX3zw2FfGVjNhes8QjMFxmjX8zpSRSm3lKQ6Qt5rmugdWg ndQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=EesV0WHy; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-70112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70112-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i7-20020a05620a404700b007873e71b3aesi3166958qko.501.2024.02.17.14.54.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 14:54:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=EesV0WHy; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-70112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70112-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1D9661C212EB for ; Sat, 17 Feb 2024 22:54:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7E1D80037; Sat, 17 Feb 2024 22:54:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="EesV0WHy" Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C33A8D53E for ; Sat, 17 Feb 2024 22:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708210466; cv=none; b=aBLKjlQj5tnmJMoU84uBJjyFPJ7UNq9e/AtJp0A0YYH2tUC8kxtGNAKBF8IfiZ7ZPtIz/SFulteUAZgQJFqwv2eH29ZTfrQ1tvIoLCT8ohyzBOYDkklRazVl05T5KxJfTHSDnVa49QDtbB5W4GUgD7G9aBPifeQR6NDAzw3RtMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708210466; c=relaxed/simple; bh=XDhHzhFUoSKCvf5U3d80vjaOp0eV3L/3tHjpvCtq624=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tXgkw0F03yRwU+DuW9DkPFsjFZsVAXjerxCeOF8rUiw9a6MgFJpSXKtPe2nTd3s7xG73SPSLs1OPj67f0FREM/SWnUV0UNOMczxgXNQ8btlQunWR9GUeUK7U2yy+KdXuh9y9CBj9APgY2o11uFI6UdrFx6ofc3DVrRU1dJPZd5Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=EesV0WHy; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Sat, 17 Feb 2024 17:54:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708210462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J+S6PW8NMbxHlN/D+9fN8tZavb8MoLjIhahjYs7L4uw=; b=EesV0WHycikgvD8TxICWEfkLtoqeLrZqOy4/34fNhukFudlieIFFENmw971agb4Zbje4Xi 4W8o9av7r7YyoAlwLgZZgnrQmDNYprREuX9yB2/bFP+cI6f3tL8gNGQCiE5qioPnwZnebn dvev4aPMUnSF4sBOIpI/xDiNwgI4FLk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, lsf-pc@lists.linux-foundation.org Subject: Re: [LSF TOPIC] beyond uidmapping, & towards a better security model Message-ID: <7gcfxbtwrylgamcbcnft37atyo34vqvbkxr2fp3k26le7vblob@ncqr7dopb2qk> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Sat, Feb 17, 2024 at 10:31:29PM +0000, Matthew Wilcox wrote: > On Sat, Feb 17, 2024 at 03:56:40PM -0500, Kent Overstreet wrote: > > AKA - integer identifiers considered harmful > > Sure, but how far are you willing to take this? You've recently been > complaining about inode numbers: > https://lore.kernel.org/linux-fsdevel/20231211233231.oiazgkqs7yahruuw@moria.home.lan/ > > > The solution (originally from plan9, of course) is - UIDs shouldn't be > > numbers, they should be strings; and additionally, the strings should be > > paths. > > > > Then, if 'alice' is a user, 'alice.foo' and 'alice.bar' would be > > subusers, created by alice without any privileged operations or mucking > > with outside system state, and 'alice' would be superuser w.r.t. > > 'alice.foo' and 'alice.bar'. > > Waitwaitwait. You start out saying "they are paths" and then you use > '.' as the path separator. I mean, I come from a tradition that *does* > use '.' as the path separator (RISC OS, from Acorn DFS, which I believe > was influenced by the Phoenix command interpreter), but Unix tends to > use / as the separator. To me, / indicates that it's a filesystem object, which these are not. Languages tend to use : as the path separator for object namespacing - heirarchical paths, but not filesystem paths. > One of the critical things about plan9 that means you have to think > hard before transposing its ideas to Linux is that it doesn't have suid > programs. So if I create willy/root, it's essential that a program > which is suid only becomes suid with respect to other programs inside > willy's domain. And it doesn't just apply to filesystem things, but > "can I send signals" and dozens of other things. So there's a lot > to be fleshed out here. My proposal is that a user is superuser only over direct sub-users; so in your example, willy.root would only be superuser over willy.root.*; it's just your normal willy user that's superuser over all your sub-users. That means that our 'root' user doesn't fit with this scheme - the superuser over the whole system would be the "" user. Or perhaps we just map our existing users to be sub-users of root? root root.willy root.kent? User namespacing in this scheme just becomes "prepend this username when leaving the namespace", so this might actually work; bit odd in that in this scheme there's nothing implicitly special about the 'root' username, so that becomes a (mild) wart... easily addressed with capabilities, though.