Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp593520rdb; Tue, 16 Jan 2024 09:34:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYjqc4itxY94jX/ehPrnv2sGphc8BJvyaR9yLndww+3UG6xfsyBLSl2rF5adEkwKAk0r3E X-Received: by 2002:ae9:e714:0:b0:783:34c3:c2cb with SMTP id m20-20020ae9e714000000b0078334c3c2cbmr6596527qka.153.1705426441399; Tue, 16 Jan 2024 09:34:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705426441; cv=pass; d=google.com; s=arc-20160816; b=HastKPHwFjEgtGDXAJiYQecjVHI0S6NkkZ8vBAp2e80qESPCsBjvA2Mmzqv4QNWlJT qGqN2iGFvIW2gJYNByiv2TrBD7NtpgGFOFc8MPNo1AuhB/H3pb/qTAtivvl/eRsNTuJr BBl0slXkZqNvI3xz0TJCbH1XJFm/+Bp/qcTRTc+ZLGYopeQ5G/V1KssaCduxL9amOq5O NL4+5Ky2NhZgTBKKeU5YzUXZQGujisZJO+ZToQhiDEnhJUSgJ4fvcfGcTlkt3mni+1BF sieSf47f1br8YgQpYcTi5eq+axNzm72c9DJPSmGWfTOwR64ywDxH6er89bR7fyiwXQTB iL2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=S+5my9jXWKBreUOHlR6pw/2iHlpnFX5ZhPEFeXmOIzU=; fh=aDvkg8Uxl/3C49iTxC2xoYEb8w1Gyg8a5Cqs+TI62nA=; b=neWihmnmgIWi95uiq+O+JDjKMINIKajJhomn3Wt1Wk71xQPVnu73OdOLHPPe2NnxCB 1HPQ9Sn1hTI4OYzUL+yUMIHXsm/RhMWhjb/5uz9who+QQbavLL8c0YSmRqT6oRL1gJfc JwwF+t83E3gx5lwUR/xF7JmHD14VGCMc8eoqJbq0CtuJTFU4SJTjuKe9BgCM7060HumM tWIPvZdrQHOth36uelTDTeHOnqk9NOaKwtHqVcRZovYXnguRCFB6JHqqFdG0LjXoAloz luOcgsPy542bewf7DTzCsdYbnFiDtJJr9FLk8XMVJbiOvm/46mb20alLtPa5JsNBs6jD G+PQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=oB2T4v4o; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-1136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y17-20020a05620a44d100b0078347fb3382si9515958qkp.376.2024.01.16.09.34.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 09:34:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=oB2T4v4o; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-1136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 189811C23735 for ; Tue, 16 Jan 2024 17:34:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD74F1CAB5; Tue, 16 Jan 2024 17:33:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="oB2T4v4o" X-Original-To: linux-nfs@vger.kernel.org Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C96E1CA8C; Tue, 16 Jan 2024 17:33:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705426433; cv=none; b=W1JhDbTc1vQsP1u2fjT4UhzvZrIF75cH5VdhClK2ZmOXKY3Rvi2chVP0mUJp1E0KKncPqtLooogiPhyGmpnjMp+Nm0xB/j+/9QwGpCP/ywuSzwzICy0b5KL87pfFNkLCdCpB3iFtpkBUd01QsvU1jbyLXSWFH+DmnWO+ARz/p6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705426433; c=relaxed/simple; bh=eO4OQip7Vt8iBukXP9TAx2AYps5FjXjzaKh58KGbU+U=; h=DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:Sender; b=mgt7i0rhcF4NmKvI9Toxh/tR73zBv6sowCCL5cINF4EjskIlMfBvqUfHQUviYLuWFgDcmfseGZiZFbH9fPtRJLLgGyC4TLuD3RXeS+oj9F3j5tJh9CEXol6ZJfoji3rUG4idkpwQJdBc09ecuKeeceQybAXve9D/LddMnlSviGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=oB2T4v4o; arc=none smtp.client-ip=62.89.141.173 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=S+5my9jXWKBreUOHlR6pw/2iHlpnFX5ZhPEFeXmOIzU=; b=oB2T4v4oLxkQEl5he5aGeli2CM 22r5wlr+d67aycYttFH91VKhE4z4GFMtZCLZ/t5N5Dy8EnFkFyO35Kx+42NeZjon4az/S7jao3zQt oOc30bwbkfVK/bIYToXwaAZijTrmhqgvTSExU0PZXKz9Y32gME5PiJX6f/o/VOYV8YFOoTBQd5cZR N/U6CgHtJ9kHws5CwSe0OijCh0Y08yklS2uRQzVYk4NnUCpXG4Kgq1QDaW/CY7H1uoe0ZCn6BPK1l dDTU5uHuJNYSfiOyxHFVJdpvoTrZBff9+VvcrIVStbRrfPIka65NVBC0E6aS32uosVxIU6OnOllvV x718UZbw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rPnJN-004gXh-1E; Tue, 16 Jan 2024 17:33:17 +0000 Date: Tue, 16 Jan 2024 17:33:17 +0000 From: Al Viro To: Casey Schaufler Cc: Roberto Sassu , brauner@kernel.org, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com, dhowells@redhat.com, jarkko@kernel.org, stephen.smalley.work@gmail.com, eparis@parisplace.org, shuah@kernel.org, mic@digikod.net, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, selinux@vger.kernel.org, linux-kselftest@vger.kernel.org, Roberto Sassu Subject: Re: [PATCH v9 13/25] security: Introduce file_release hook Message-ID: <20240116173317.GL1674809@ZenIV> References: <20240115181809.885385-1-roberto.sassu@huaweicloud.com> <20240115181809.885385-14-roberto.sassu@huaweicloud.com> <20240115191508.GG1674809@ZenIV> <3b440f064a1ae04d69f7e85f4077f8406c0eac67.camel@huaweicloud.com> <00b7ff22-f213-471a-a604-658a9af80d59@schaufler-ca.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00b7ff22-f213-471a-a604-658a9af80d59@schaufler-ca.com> Sender: Al Viro On Tue, Jan 16, 2024 at 08:51:11AM -0800, Casey Schaufler wrote: > On 1/16/2024 12:47 AM, Roberto Sassu wrote: > > On Mon, 2024-01-15 at 19:15 +0000, Al Viro wrote: > >> On Mon, Jan 15, 2024 at 07:17:57PM +0100, Roberto Sassu wrote: > >>> From: Roberto Sassu > >>> > >>> In preparation for moving IMA and EVM to the LSM infrastructure, introduce > >>> the file_release hook. > >>> > >>> IMA calculates at file close the new digest of the file content and writes > >>> it to security.ima, so that appraisal at next file access succeeds. > >>> > >>> An LSM could implement an exclusive access scheme for files, only allowing > >>> access to files that have no references. > >> Elaborate that last part, please. > > Apologies, I didn't understand that either. Casey? > > Just a hypothetical notion that if an LSM wanted to implement an > exclusive access scheme it might find the proposed hook helpful. > I don't have any plan to create such a scheme, nor do I think that > a file_release hook would be the only thing you'd need. Exclusive access to what? "No more than one opened file with this inode at a time"? It won't serialize IO operations, obviously... Details, please.