Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1403374pxf; Fri, 12 Mar 2021 08:44:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpqEGQsXnGgPxdeE2RykvWd8BettOSR+X94XdODBE7AZHwrRBlwT4jbkXmmWKqyHiNgw6H X-Received: by 2002:a17:906:381a:: with SMTP id v26mr9317176ejc.346.1615567458237; Fri, 12 Mar 2021 08:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615567458; cv=none; d=google.com; s=arc-20160816; b=UuJ0nhVEeJmrOU73H0BW8+B/8xqTwwmifVEv0n7j9Q+NIxqgZIi/B7d4HNqbZVJJe2 ZcSiLtCVWZh2fd8Ff9Oyt9zKPMpSm66ja7fVsh/1jksn6oS0Ft3SKIM/Yy4vMTWWmaHm +k/V/acPjyMp/TBSM/hM3pCnwl2KrKUAoRAvMdaRSxLiCMdewnD56frlf4InWUbuW1Rb 3H23cWmBh9pn6zIuJJy0+dDvIzDH/YFGnCdA5J0PX/P2bhq3qdCgmTxIuHcu4yLMN9lq lUPFT60AyRK3SD5/wUb0yQOfupwZ07g/5JS73Zg6ez140LZ2S05bZJY6Rap/J48JwGoP q5bw== 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 :message-id:date:subject:cc:to:from; bh=Fgt5hdCR03yJ4LlMnVng61gdxxCj9z+sXVpAnxz4h6E=; b=xuluqixBH6ZWmbQ798sC91KTSpNlBZqEQu+2oA1PnAlS9NkRUVXQ+D3K8tgiHU4Ssc GxdSjD0ICYcxOaPgNapG47g8LeG/Cl3fBJDwYqA9cAMBVDC3uNjqvMo6dg6DEWVPDcUW KlHvTYbylWGzuvlyPb+0j2RS4atE9l9rL1yep8uWjtRQnrRvYAKu/+3CUtAVoBVwbv83 6sxIreihfV+XvdmO3hnQE0hNsQyUrZUiPqTt4WMdYYISqpiVtpHKv1PYseU+4BzdxVaL g9L0crzgGfAKjpQopXb6i6jRthyZsUnsBSBk7dqpwUd5E14RXLc8mJe/KAZ9XqvOBH2m AS+A== 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 de53si4468703ejc.358.2021.03.12.08.43.55; Fri, 12 Mar 2021 08:44:18 -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 S232795AbhCLQmq (ORCPT + 99 others); Fri, 12 Mar 2021 11:42:46 -0500 Received: from raptor.unsafe.ru ([5.9.43.93]:49754 "EHLO raptor.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232949AbhCLQmE (ORCPT ); Fri, 12 Mar 2021 11:42:04 -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 3173340C98; Fri, 12 Mar 2021 16:42:00 +0000 (UTC) From: Alexey Gladkov To: LKML , "Eric W . Biederman" Cc: Alexey Gladkov , Alexander Viro , Kees Cook , Linux Containers , Linux FS Devel Subject: [PATCH v6 0/5] proc: subset=pid: Relax check of mount visibility Date: Fri, 12 Mar 2021 17:41:43 +0100 Message-Id: X-Mailer: git-send-email 2.29.3 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]); Fri, 12 Mar 2021 16:42:01 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow to mount procfs with subset=pid option even if the entire procfs is not fully accessible to the mounter. Changelog --------- v6: * Add documentation about procfs mount restrictions. * Reorder commits for better review. v4: * Set SB_I_DYNAMIC only if pidonly is set. * Add an error message if subset=pid is canceled during remount. v3: * Add 'const' to struct cred *mounter_cred (fix kernel test robot warning). v2: * cache the mounters credentials and make access to the net directories contingent of the permissions of the mounter of procfs. -- Alexey Gladkov (5): docs: proc: add documentation about mount restrictions proc: subset=pid: Show /proc/self/net only for CAP_NET_ADMIN proc: Disable cancellation of subset=pid option proc: Relax check of mount visibility docs: proc: add documentation about relaxing visibility restrictions Documentation/filesystems/proc.rst | 15 +++++++++++++++ fs/namespace.c | 30 ++++++++++++++++++------------ fs/proc/proc_net.c | 8 ++++++++ fs/proc/root.c | 24 +++++++++++++++++++----- include/linux/fs.h | 1 + include/linux/proc_fs.h | 1 + 6 files changed, 62 insertions(+), 17 deletions(-) -- 2.29.3