Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1620729ybg; Thu, 4 Jun 2020 14:42:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk5Iuoxr3FE7BUSOzdba3lSB1Ly/vByDeCuN9nDhljw6HBQcEfdCE3FcN/tnIYilqs1fHn X-Received: by 2002:a17:906:af84:: with SMTP id mj4mr5435932ejb.473.1591306945716; Thu, 04 Jun 2020 14:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591306945; cv=none; d=google.com; s=arc-20160816; b=FjuhU6hmqr+6cCscK81Kekg0r3MaYVayEObmBQe3mg0B7TexQ6jfXBFLb+s39rI+mM t0/q5txTC/HmVSbKPv/GftbTanyzI40NXbFxXKx7leoBzsPZ2Lh7l1iM3Mk+OPy4jSn8 nOM3ilSg+1qcxHkpf6Q9iJ6zufINXiL4+4x9ZRtIkFkjVil8SrAKMBVHlQR7BWyEsZeW 5AamWR4as9ZzfYI+8980k7MA4Kt7ejC+Q5celBePvWAafyda4tJldAMwD/TRY79gVomH ZxvnMrXrKQSNC7OZOsS4K3+orBofmqOmm9T1wc+FtmO+QKjqeXqYhCIAQp0sm3FJl83V q1ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Nt+5AAzy8luYC+4uwyZw+q+5YxfcCO3uBXt+9SXUrvQ=; b=aTkleJD9EqHJA+36ZXJa/8xYuLdYFMKFxNVbNZsMAiQ2/F8qVmOnBMVIZeWZ3PiCUt TopBVsiJlQPoJlXLr5xGOb/UUghuyFFHmkUGivrdYrwmkUSO5rmtfe3XqFcz1vNi+Sgy iq52SNzv62xjkhCqACjQN0U1icHgPre2XKISm5lu5xD3Zzt3kK1yBMCqdFKEkQWDj13n 3Hc5MYf4VfsyGkhgs5oN1TvF+5XCo6PHUD3fCVVGqF8cNRtCmJDEFSYLNctzByTOV1SF 7ZhVLsE8M8dXQ+OAFxetoexyy1fIrw7Qy90m3vPnmoksnpDc0Zl0C8QBruGg7WKKk0p/ eMSA== 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 n24si2588474edb.277.2020.06.04.14.42.03; Thu, 04 Jun 2020 14:42:25 -0700 (PDT) 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 S1729683AbgFDUEf (ORCPT + 99 others); Thu, 4 Jun 2020 16:04:35 -0400 Received: from raptor.unsafe.ru ([5.9.43.93]:54018 "EHLO raptor.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729571AbgFDUEf (ORCPT ); Thu, 4 Jun 2020 16:04:35 -0400 Received: from comp-core-i7-2640m-0182e6.redhat.com (ip-89-102-33-211.net.upcbroadband.cz [89.102.33.211]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by raptor.unsafe.ru (Postfix) with ESMTPSA id 6BDB5209AF; Thu, 4 Jun 2020 20:04:31 +0000 (UTC) From: Alexey Gladkov To: LKML Cc: Linux FS Devel , Alexander Viro , Alexey Dobriyan , Alexey Gladkov , Andy Lutomirski , "Eric W . Biederman" , Kees Cook Subject: [PATCH 0/2] proc: use subset option to hide some top-level procfs entries Date: Thu, 4 Jun 2020 22:04:11 +0200 Message-Id: <20200604200413.587896-1-gladkov.alexey@gmail.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.1 (raptor.unsafe.ru [5.9.43.93]); Thu, 04 Jun 2020 20:04:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greetings! Preface ------- This patch set can be applied over: git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git d35bec8a5788 Overview -------- Directories and files can be created and deleted by dynamically loaded modules. Not all of these files are virtualized and safe inside the container. However, subset=pid is not enough because many containers wants to have /proc/meminfo, /proc/cpuinfo, etc. We need a way to limit the visibility of files per procfs mountpoint. Introduced changes ------------------ Allow to specify the names of files and directories in the subset= parameter and thereby make a whitelist of top-level permitted names. Alexey Gladkov (2): proc: use subset option to hide some top-level procfs entries docs: proc: update documentation about subset= parameter Documentation/filesystems/proc.rst | 6 +++ fs/proc/base.c | 15 +++++- fs/proc/generic.c | 75 +++++++++++++++++++++------ fs/proc/inode.c | 18 ++++--- fs/proc/internal.h | 12 +++++ fs/proc/root.c | 81 ++++++++++++++++++++++++------ include/linux/proc_fs.h | 11 ++-- 7 files changed, 175 insertions(+), 43 deletions(-) -- 2.25.4