From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82995C433DF for ; Thu, 14 May 2020 10:40:19 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id E29752053B for ; Thu, 14 May 2020 10:40:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E29752053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18789-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 25943 invoked by uid 550); 14 May 2020 10:40:12 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 25911 invoked from network); 14 May 2020 10:40:12 -0000 Subject: Re: [PATCH v17 05/10] fs,landlock: Support filesystem access-control To: James Morris , Casey Schaufler Cc: linux-kernel@vger.kernel.org, Al Viro , Andy Lutomirski , Arnd Bergmann , Casey Schaufler , Jann Horn , Jonathan Corbet , Kees Cook , Michael Kerrisk , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , "Serge E . Hallyn" , Shuah Khan , Vincent Dagonneau , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, x86@kernel.org References: <20200511192156.1618284-1-mic@digikod.net> <20200511192156.1618284-6-mic@digikod.net> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: Date: Thu, 14 May 2020 12:39:58 +0200 User-Agent: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.6.0.2.8 X-Antivirus-Code: 0x100000 On 14/05/2020 05:37, James Morris wrote: > On Mon, 11 May 2020, Mickaël Salaün wrote: > > >> diff --git a/include/linux/fs.h b/include/linux/fs.h >> index 45cc10cdf6dd..2276642f8e05 100644 >> --- a/include/linux/fs.h >> +++ b/include/linux/fs.h >> @@ -1517,6 +1517,11 @@ struct super_block { >> /* Pending fsnotify inode refs */ >> atomic_long_t s_fsnotify_inode_refs; >> >> +#ifdef CONFIG_SECURITY_LANDLOCK >> + /* References to Landlock underlying objects */ >> + atomic_long_t s_landlock_inode_refs; >> +#endif >> + > > This needs to be converted to the LSM API via superblock blob stacking. > > See Casey's old patch: > https://lore.kernel.org/linux-security-module/20190829232935.7099-2-casey@schaufler-ca.com/ s_landlock_inode_refs is quite similar to s_fsnotify_inode_refs, but I can do it once the superblock security blob patch is upstream. Is it a blocker for now? What is the current status of lbs_superblock? Anyway, we also need to have a call to landlock_release_inodes() in generic_shutdown_super(), which does not fit the LSM framework, and I think it is not an issue. Landlock handling of inodes is quite similar to fsnotify.