Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1222833ybk; Thu, 14 May 2020 03:42:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6ufva0z8/T4XR4/A/JDYApvL+gsoUZoY8SSkxAZQYPUDikfDqLdXH76cu3vhGj5l/X+I1 X-Received: by 2002:a17:906:2bc1:: with SMTP id n1mr3294391ejg.34.1589452926049; Thu, 14 May 2020 03:42:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589452926; cv=none; d=google.com; s=arc-20160816; b=K1M0BJYGM0eDlFdlo2/ZSipBLXLIxgB6of52DiwdXtsfainRFFs89TWREGYEp0BHfo ITMlyBx/BlT7/yOrfWzOXONJhiYN/7Gi9DTC6sv9YM2pj77oRmWDgk6A/ucEfantoyH6 LS3pvymOb4W7nL2UncIXGJmXFRmu+JztisKsH2CexSD3ouTNxA9Vprr3GlwV1AECOS/s sbMjobTeuDu5ZPs/GPq6FY1lFvPfC07eFfKpESHRAthdtRSCPLJqyLMyvNfq70SP0vVV k/st0LWgbCRUZ5f9lZ4hrXcgReh/xYFKf5mpPuw67okrhIC5IJhWmrwjoRn3Byu9LzQT tA1A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8pdwYybVxuF7jtlX1ckTT4zVvNlOUfpApv2CG5H0cXU=; b=Q5A7Dw/srbUP1SLBQrmmHUdHC++vC/HoasVdxgkKAVA0v8+39F9RaZUFKlvh12UCE8 EPj+H5erB8sQIw9GOt6FWK54mdsBDxVOnxBa3HSjy2zfs5Udt863rTnJb7g5mrQkbkdi LnPP1TNii8hR9oTPSlxxxam/pjag3G2dKVP9eTPAOH0hvUS6OL+0A/KndGQFjFa9bSpi odCU0nCtfjbysjtzqJNTAym3MOVKZbYLLu+pxBbf87x6XUto2xnIQ2Gy2P2FoQT664G3 gEGxkIh9K4357mdWPqENLJxHcf2viin+xCFeWez4YiLA2/EUZz3BQHzrMJ04UB9TLP6O GuvQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt25si1338619ejb.511.2020.05.14.03.41.43; Thu, 14 May 2020 03:42:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726199AbgENKkC (ORCPT + 99 others); Thu, 14 May 2020 06:40:02 -0400 Received: from smtp-1908.mail.infomaniak.ch ([185.125.25.8]:35641 "EHLO smtp-1908.mail.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbgENKkB (ORCPT ); Thu, 14 May 2020 06:40:01 -0400 Received: from smtp-3-0000.mail.infomaniak.ch (unknown [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 49N7N05RDVzlhpy6; Thu, 14 May 2020 12:40:00 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [94.23.54.103]) by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 49N7Mz3W0czljKBC; Thu, 14 May 2020 12:39:59 +0200 (CEST) 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.