Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp497766pxf; Wed, 10 Mar 2021 10:22:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGkchWsJg2RPhFY60uq4t+PqSiJ/YNtZ/xVoYUg98KD3k2fTBCVwS8KaMtrU7UUsS8Skm3 X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr4790377edv.374.1615400528282; Wed, 10 Mar 2021 10:22:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615400528; cv=none; d=google.com; s=arc-20160816; b=C+/vjg8WRmx9+Ykv7ZrZzidU7rwtak4GcRGf0nfaLBFNra8ctN+hu9TDQXAsuZH85w sk3MPvZYc0XK67MKxGJ/7+XFxvmnI8QsGMrFZ3AJENUsi9k/fCHE9vPhTci9uVc0/2zf UcTS0ujbHR8Qfq98CyA1WcRtfbSOwECFKp5knU+xPbfEJv+op5OH+OKkcC47xHt7nEMr Q1U1OsFKBo2a/bt6ocMqOk3GRCY8T2fhCXjpZ+HhsFGYitQu00AKFG1nNOm9eVkCeuRY 2O9Fw04qOhugE8oSf+WRgX11sHeG0TWdg7Gd9yj8a8pxrDvTJTkE7ZWlSn1RgpPuGWIy 50Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Alkv3gpZ+kswd3jJmJ7aB6nsz8X31EqV1iCaMw40B0o=; b=JkIpE5fJhJF023MtPiebgMvQU4PrnbtClmHyI8uBwyciX55oMCXy1Kkf8Lc6dp+Ea5 EopZNekuyPqJAPCRtDilgyRskgO8/zGQqRXzTraymSGWIToV7PIkWbJ3+Wu+l1fMyph3 fQNClbQypu8sLP5XhxWwHpHicbwcwyDJq7KJ6qiJlD9tnvqkSCVGWB2PRxodTXut3+lc 2euLVxuCM4xLGE7S5nRQt/orhJzSutkp15N/B2SgmKUAseDkLurMMzvkpobknquRr5OS w6Pk/fS0W3tizjUQur7iRYyUTZxy6twfrRDShcQCLaSVW509DQ0gkpXAP5mzw2peXLzy vHYw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 bf1si136607edb.359.2021.03.10.10.21.46; Wed, 10 Mar 2021 10:22:08 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233749AbhCJSUt (ORCPT + 99 others); Wed, 10 Mar 2021 13:20:49 -0500 Received: from raptor.unsafe.ru ([5.9.43.93]:56482 "EHLO raptor.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232828AbhCJSUV (ORCPT ); Wed, 10 Mar 2021 13:20:21 -0500 Received: from comp-core-i7-2640m-0182e6.redhat.com (ip-94-113-225-162.net.upcbroadband.cz [94.113.225.162]) by raptor.unsafe.ru (Postfix) with ESMTPSA id 87B0140F00; Wed, 10 Mar 2021 18:20:19 +0000 (UTC) From: Alexey Gladkov To: LKML , "Eric W . Biederman" Cc: Alexey Gladkov , Alexander Viro , Kees Cook , Linux Containers , Linux FS Devel Subject: [PATCH v5 1/5] docs: proc: add documentation about mount restrictions Date: Wed, 10 Mar 2021 19:19:56 +0100 Message-Id: <333cf0c988255d7bf54871ad4fa02af2aaa8d4a3.1615400395.git.gladkov.alexey@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (raptor.unsafe.ru [0.0.0.0]); Wed, 10 Mar 2021 18:20:19 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Alexey Gladkov --- Documentation/filesystems/proc.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst index 2fa69f710e2a..3daf0e7d1071 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -50,6 +50,7 @@ fixes/update part 1.1 Stefani Seibold June 9 2009 4 Configuring procfs 4.1 Mount options + 4.2 Mount restrictions 5 Filesystem behavior @@ -2175,6 +2176,21 @@ information about processes information, just add identd to this group. subset=pid hides all top level files and directories in the procfs that are not related to tasks. +4.2 Mount restrictions +-------------------------- + +The procfs can be mounted without any special restrictions if user namespace is +not used. You only need to have permission to mount (CAP_SYS_ADMIN). + +If you are inside the user namespace, the kernel checks the instances of procfs +available to you and will not allow procfs to be mounted if: + + 1. There is a bind mount of part of procfs visible. Whoever mounts should be + able to see the entire filesystem. + 2. Mount is prohibited if a new mount overrides the readonly option or family + of atime options. + 3. If any file or non-empty procfs directory is hidden by another filesystem. + Chapter 5: Filesystem behavior ============================== -- 2.29.2