Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp818391rdb; Fri, 9 Feb 2024 01:59:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5c2JriFaDzCVcMVaAPRSYPHCH/JYSBcgdYoaWFiCw95VjVTZqa4LGS7D3qHR4I8ub136E X-Received: by 2002:a0c:f549:0:b0:68c:4e10:a713 with SMTP id p9-20020a0cf549000000b0068c4e10a713mr1012483qvm.17.1707472796697; Fri, 09 Feb 2024 01:59:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707472796; cv=pass; d=google.com; s=arc-20160816; b=mttSbgsnfbgHF8Bh13zUuk/0FSt2FlggiFMO9NyRVniAnh9Bk/8FiCp0LiRPbRytJm zQY31qMGLDbUm4iU2FT+QioMqUS/oZoOIckIOamHGpr2LpG+sU6xQeUDwuvfHYiB0gkx 7lLKyBTNDruuYnQgJwCmhvQfkV/2hzvs4WlF2DfOV1v9xK5j08s/vwMnirHG++MTbQ1y LMLO4ura/DMdUVs0ot4f65L9hAAuKgRo4HoyneP06amqpwEvRAfDECLg4w+qIi5Xgvwu 12Mmbs4xO0tR+gvSy/eMaWrFjCCOZB/6ZhK5ausvOfkpgAamN0eqeGNWLsuF6JryOjek rTFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=7YR1INy0Vkk1kA/lYeFEarTwvSMZmVjj9Q29Bbgk2HI=; fh=jz53yIWV7vEKKVGmdapBQnmHKyBQzaC7xYZ1VSOSm68=; b=nLRE/BUu4FEgPA1LajLwsl+YuwD3stRB0qYLfenkbH0v6ZdLMyn9oXme/YOvOn1f4j baYmHT2uIXdfXYr5CdpwKJUoV+KpZmrLGkZpFjHjksQDsi3525/1OzDnA8/LTvPeJCdr 1FGBpdLWMT4TjDaPRHPH6JTJmHi2RMshT9poXQKUBSWFGsss+1EAxM+JPtrmX8hx8U16 mr8T7xpSlezp4WPUt27s9pWVTcJAYYXxizHy+eliuR+rDCUo5R9uEbT+BS+PEfRp8YEp RygQ9rF+qtlkbY5TFmE1NAgrp6uFzXRFpDf31g12g3BCMZosmZIUHDE2uEgsiuJP3YgE Bs+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qFelY5Gt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCW9ohfihNMKPva1QQ6bXLHF9hCC67PrlIgEQrgfMRUwzf+yZBF5er65J/iFZz1Dau2vWopv1jz8U21HCG85+PJr1uegqKWCFTWVapmFmA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id js13-20020a0562142aad00b006818b5647f0si1535291qvb.552.2024.02.09.01.59.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 01:59:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1880-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=@kernel.org header.s=k20201202 header.b=qFelY5Gt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 710A71C253A8 for ; Fri, 9 Feb 2024 09:59:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F38167E66; Fri, 9 Feb 2024 09:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qFelY5Gt" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 47755657B0; Fri, 9 Feb 2024 09:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707472792; cv=none; b=YdDsxoFnHEQ7c+fcDKOj7KNvaY6ar+3Aq+yR8aUg6Yy4XcoLAveVvDKrMSOd9zzetBkiFVWxK1reVtqYVMy8euSpBWBubbyasZovruSTmhnWYUa7oG+Dn00ZIBdDEJdZPFIAdN0DRwjyP90JExgS081OF0mUyTf53SnHwUxVRUE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707472792; c=relaxed/simple; bh=fY8XhgsREKr/Fhdp2itvjdD+qMPJVaofVRb9lUhD3nQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kLCrBa67qtc0sRSkBgWL+QDGLyflEnS8htl6QBM8w0QrwHT1DjnwQrYWpwkaHtRxDJHHKNOEAf5mhkLT4GcoHwFUT0Ac1PklKbRcb+seWy38/E7hwaTQ7IJUmaoorJmudpxqbXy0GgoayS7tbUX3o1Gq92FphqlhPPqANAJ/7/Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qFelY5Gt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAEC3C433C7; Fri, 9 Feb 2024 09:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707472791; bh=fY8XhgsREKr/Fhdp2itvjdD+qMPJVaofVRb9lUhD3nQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qFelY5Gt/fg78SHCgqTtWzVfzfKWzMGpy8YcZj5oquBVSIPR+KETu7glgxijNPGNY Ygs7huivMiZViTGEUrVjFfvGN//gSsPtQFxH35iRUttJ5gtQSj4/757M5ylKpNRRRj 887Dxiogp7d+75aNymSqyWQMlgNk9QO3I9qJ6hkXp794WDgyvN99vJMoQOncHyPAsa 7kejYUkWEJr+UTznvlOIqIg0TMduRShwZD8M7kNMnVEhPdZBXmcfiJH0IFBW7slsRL 5h5XOmYDAnmPG6ncQC1KWhs/8bgpDv1l5Yx1zVE2FxmJN7JrD4ucQWdlKA9LxU9uBt 9qnevPqDlB1AA== Date: Fri, 9 Feb 2024 10:59:42 +0100 From: Christian Brauner To: Roberto Sassu Cc: viro@zeniv.linux.org.uk, 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, casey@schaufler-ca.com, 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 , Stefan Berger Subject: Re: [PATCH v9 12/25] security: Introduce file_post_open hook Message-ID: <20240209-kunterbunt-abgefackelt-04b54394da2a@brauner> References: <20240115181809.885385-1-roberto.sassu@huaweicloud.com> <20240115181809.885385-13-roberto.sassu@huaweicloud.com> <20240209-wertlos-opern-45e9bce87014@brauner> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240209-wertlos-opern-45e9bce87014@brauner> On Fri, Feb 09, 2024 at 10:56:33AM +0100, Christian Brauner wrote: > On Mon, Jan 15, 2024 at 07:17:56PM +0100, Roberto Sassu wrote: > > From: Roberto Sassu > > > > In preparation to move IMA and EVM to the LSM infrastructure, introduce the > > file_post_open hook. Also, export security_file_post_open() for NFS. > > > > Based on policy, IMA calculates the digest of the file content and > > extends the TPM with the digest, verifies the file's integrity based on > > the digest, and/or includes the file digest in the audit log. > > > > LSMs could similarly take action depending on the file content and the > > access mask requested with open(). > > > > The new hook returns a value and can cause the open to be aborted. > > > > Signed-off-by: Roberto Sassu > > Reviewed-by: Stefan Berger > > Acked-by: Casey Schaufler > > Reviewed-by: Mimi Zohar > > --- > > fs/namei.c | 2 ++ > > Acked-by: Christian Brauner Redacting that. I have a question.