Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1270164pxb; Fri, 21 Jan 2022 13:58:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIYnb9Q2FrTdjS3h+Fa4jRByPJZMeB1/kX1OeLa7EkhuyVUuAjjofpCYmc6NVI6aIk8fZR X-Received: by 2002:a17:902:8212:b0:149:af87:9f9d with SMTP id x18-20020a170902821200b00149af879f9dmr5392323pln.39.1642802282486; Fri, 21 Jan 2022 13:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642802282; cv=none; d=google.com; s=arc-20160816; b=p3bujyz+DjemAFyO8LwJ4cl3WFGFa09FRLMcdAVTXy4nY3Jj4YJep7Nj4IfjEUYZzj xUVNQ003wGAApocEI8pDVr0lRewj9LLCYu3dIwQB289M6yqw36Oq9ku9CrXdlGQxv707 HxR9uiIs0kRcvLWI0mOdr+Myg3fS1ikUiVfqG6i+BBeAUOmAWNDRiZvVNWbHpFIW3gCj cV/h0O/1kya8olKqChw+HlGMkN7l8sSpsaYp0m+iSfPItDX/X6kijpcLr73vCSdWmyiQ mtDpSVuozuBFei54ZXdQUmxpqMFicZnDADEup63OpruAaXJqZaHjKxn0S00xHlVUawKw xWQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XHbVxPVvQxKFGbV2gO92+uYdrWX0wSKGNZ+qAac9RH8=; b=mFDUn7543sF/J2wGYE4AenN3+i/94wt6OhCXx+aeARtx7Bs3bMf05uMis9yL+DbPjI Pt7diIHEGd6X34rQAqS3udn+X+jSuE4H0SNEIrruvUN85ssbHJGTSvGUdQf0BQzK82IJ kEiz6VxDc7k0blAfXOOiQkqyjAA0oSgWC+QD9sSX9Tw/qns8NskGBCz61ZnSarhDEsys J/Ei0Lrd3qBhzCywUX5ZeSRLJe/wRDIcCZZ9bksnefthkZ7ij6gZM8o2Mallb1OTFPaA 2jeAxsW/lVxt0D669ImSHk/XYjdtA6TsHYMjziiZL0v+0x5A3jCpsTuzJUm/apMT5D6S A6Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mJstJer9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si6493722pls.313.2022.01.21.13.57.50; Fri, 21 Jan 2022 13:58:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mJstJer9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241562AbiATMXN (ORCPT + 99 others); Thu, 20 Jan 2022 07:23:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232146AbiATMXJ (ORCPT ); Thu, 20 Jan 2022 07:23:09 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA029C061574; Thu, 20 Jan 2022 04:23:08 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id n10so12274213edv.2; Thu, 20 Jan 2022 04:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XHbVxPVvQxKFGbV2gO92+uYdrWX0wSKGNZ+qAac9RH8=; b=mJstJer94oSZPY77xchw20ydWv6462Svb1zFv5diZWooveJU9tqXs2kOSY7V5mHXpj emKeJAo8rItxJ13PcQy57kE4GSvx4FXZYbdzUYOx01x8Qzp6ezt+fDgj75/+pjPIvgth DfaudXa7VyjI5qdB9LRszLnIOkoYHbTKv/y76XCeoJUxeOi06FS4c6svi2w7k8j1at57 +8uaAaVjqTcxJxdNz2pEJz90g3SzBtoGCsz4UoLexzMufzAlgL9sGGR1O/m8S2+z4m7h m+2tmcQXZvli87AW++6tgNSVpsTQ6UMp1Pe2wERnjXdXy3E1c9Vt3rqvXed+n1VxhaE7 1x+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XHbVxPVvQxKFGbV2gO92+uYdrWX0wSKGNZ+qAac9RH8=; b=AbSHh4dLqdGslEfOBEZlxN1e9bWnUjhJcqoEcIxLnwWRKXXPWNAswbJJu6Nx5Y1qUc +b+l4hmwSq7XIoxlrwp1vAhsi44NICC6aa958/zmVgaU3b3jZAuEB8e15jbDu/jaSnHF Ap423qpulrTqWbu/r8m8WtZSZJ9kcXaYFHNxxjr43PwSNRKMdwIhNWHE3FmIlaLSUP/f GI16tEe9NsRFZWJVeKmZc8slOm7foRddAvFtpNiUqgr11EiXLikPfaVg3rKAiIFBlFKW SCVsW3KqnHdqqe6TBj1G+Pq0Mu5CZ80u4rGRjeiMgs3YdGhw5CI2xbLeRSqq+C1E5rZ0 YC2g== X-Gm-Message-State: AOAM531SEZ+e1pd64w5sYG+3xZD3KysJFWN0iBRD5vpTXNIIWAgGJg33 v3CHeDC/WwX3AsOLm7frcA== X-Received: by 2002:a17:906:a103:: with SMTP id t3mr27826817ejy.567.1642681387287; Thu, 20 Jan 2022 04:23:07 -0800 (PST) Received: from localhost.localdomain ([46.53.254.155]) by smtp.gmail.com with ESMTPSA id gz19sm949362ejc.10.2022.01.20.04.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 04:23:06 -0800 (PST) Date: Thu, 20 Jan 2022 15:23:04 +0300 From: Alexey Dobriyan To: Christian Brauner Cc: viro@zeniv.linux.org.uk, ebiederm@xmission.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, stephen.s.brennan@oracle.com, legion@kernel.org, cyphar@cyphar.com Subject: Re: [PATCH v2] proc: "mount -o lookup=" support Message-ID: References: <20220119162423.eqbyefywhtzm22tr@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220119162423.eqbyefywhtzm22tr@wittgenstein> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 05:24:23PM +0100, Christian Brauner wrote: > On Wed, Jan 19, 2022 at 06:48:03PM +0300, Alexey Dobriyan wrote: > > From 61376c85daab50afb343ce50b5a97e562bc1c8d3 Mon Sep 17 00:00:00 2001 > > From: Alexey Dobriyan > > Date: Mon, 22 Nov 2021 20:41:06 +0300 > > Subject: [PATCH 1/1] proc: "mount -o lookup=..." support > > > > Docker implements MaskedPaths configuration option > > > > https://github.com/estesp/docker/blob/9c15e82f19b0ad3c5fe8617a8ec2dddc6639f40a/oci/defaults.go#L97 > > > > to disable certain /proc files. It overmounts them with /dev/null. > > > > Implement proper mount option which selectively disables lookup/readdir > > in the top level /proc directory so that MaskedPaths doesn't need > > to be updated as time goes on. > > I might've missed this when this was sent the last time so maybe it was > clearly explained in an earlier thread: What's the reason this needs to > live in the kernel? > > The MaskedPaths entry is optional so runtimes aren't required to block > anything by default and this mostly makes sense for workloads that run > privileged. > > In addition MaskedPaths is a generic option which allows to hide any > existing path, not just proc. Even in the very docker-specific defaults > /sys/firmware is covered. MaskedPaths is not future proof, new entries might pop up and nobody will update the MaskedPaths list. > I do see clear value in the subset= and hidepid= options. They are > generally useful independent of opinionated container workloads. I don't > see the same for lookup=. The value is if you get /proc/cpuinfo you get everything else but you might not want everything else given that "everything else" changes over time. > An alternative I find more sensible is to add a new value for subset= > that hides anything(?) that only global root should have read/write > access too.