Message ID | 20200211165753.356508-7-christian.brauner@ubuntu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=MM4E=37=vger.kernel.org=linux-security-module-owner@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CD8113A4 for <patchwork-linux-security-module@patchwork.kernel.org>; Tue, 11 Feb 2020 16:59:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C8D42086A for <patchwork-linux-security-module@patchwork.kernel.org>; Tue, 11 Feb 2020 16:59:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729088AbgBKQ7d (ORCPT <rfc822;patchwork-linux-security-module@patchwork.kernel.org>); Tue, 11 Feb 2020 11:59:33 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:53373 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728633AbgBKQ7d (ORCPT <rfc822;linux-security-module@vger.kernel.org>); Tue, 11 Feb 2020 11:59:33 -0500 Received: from ip5f5bf7ec.dynamic.kabel-deutschland.de ([95.91.247.236] helo=wittgenstein.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <christian.brauner@ubuntu.com>) id 1j1YsS-00014T-BS; Tue, 11 Feb 2020 16:59:12 +0000 From: Christian Brauner <christian.brauner@ubuntu.com> To: =?utf-8?q?St=C3=A9phane_Graber?= <stgraber@ubuntu.com>, "Eric W. Biederman" <ebiederm@xmission.com>, Aleksa Sarai <cyphar@cyphar.com>, Jann Horn <jannh@google.com> Cc: smbarber@chromium.org, Alexander Viro <viro@zeniv.linux.org.uk>, Alexey Dobriyan <adobriyan@gmail.com>, Serge Hallyn <serge@hallyn.com>, James Morris <jmorris@namei.org>, Kees Cook <keescook@chromium.org>, Jonathan Corbet <corbet@lwn.net>, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, Christian Brauner <christian.brauner@ubuntu.com> Subject: [PATCH 06/24] fs: add is_userns_visible() helper Date: Tue, 11 Feb 2020 17:57:35 +0100 Message-Id: <20200211165753.356508-7-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200211165753.356508-1-christian.brauner@ubuntu.com> References: <20200211165753.356508-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: <linux-security-module.vger.kernel.org> |
Series |
user_namespace: introduce fsid mappings
|
expand
|
diff --git a/include/linux/fs.h b/include/linux/fs.h index 98e0349adb52..1449cd363fb6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3627,4 +3627,9 @@ static inline int inode_drain_writes(struct inode *inode) return filemap_write_and_wait(inode->i_mapping); } +static inline bool is_userns_visible(unsigned long iflags) +{ + return (iflags & SB_I_USERNS_VISIBLE); +} + #endif /* _LINUX_FS_H */
Introduce a helper which makes it possible to detect fileystems whose superblock is visible in multiple user namespace. This currently only means proc and sys. Such filesystems usually have special semantics so their behavior will not be changed with the introduction of fsid mappings. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> --- include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+)