Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp826995rdb; Fri, 9 Feb 2024 02:17:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW1ySRPArD0XNwTSa+0EhwxrXuabhhc8MPYCrQxmcLEFh+gxlg1wvKaFhWxqwzNUQoeOaIBId9yH3jBZXJz52Qk/fBrohE7+eCfjBSABg== X-Google-Smtp-Source: AGHT+IFmRTvWYlk7mK4uhVspoTK51nCROgR0Q3BMJGJpBxcrm1OeYtmdP6gPj2PGjQaI9zOJKlVO X-Received: by 2002:a05:6402:31e3:b0:560:fd6c:e52d with SMTP id dy3-20020a05640231e300b00560fd6ce52dmr865082edb.11.1707473873863; Fri, 09 Feb 2024 02:17:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707473873; cv=pass; d=google.com; s=arc-20160816; b=K7+CG7U7vGGoK+2+9J+TvX1sm9VTGamj6+W5N44MLXu+0m4SkRD5rMtKyWggWVBVuU H31LNDdf8x0rzrKqGpcjRCOb9stsnSk6Vxpiqo2kc1upr33ZJnEbPVKlEXof3wxgLeaD xWaliZKT+6e9cTKkW7U2Rwms80peT7DQpxmemEcdn5+YcUyYSFPlXHdfOMcX7AGOxRR2 zsDfaT18LvL37x8aempbcrWWbpfcrvn03fQ7i2d8JDI91xbmf4PbIcV/VLa/zucNWLEi ar4NTKUpV9/iDFpRE9IjBOWJCQ99r3yADvairTkOqxkzDkP9p2Py56wJOEdvKmWZe/Mp sfmA== 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=aCM8xr6wuaf4LnZ42CDC4ROtAVbEi+0H952Eepe0DCQ=; fh=EU4eXN6ASM2xfcyWqvUJv8FlhM8FUpR8xw6bKaL6L3s=; b=02OFoX3oeTceQqhI+r3KXik5ptRbas3vuJ7cxcjn0w/ghrhtLYnHq3VOVtfiCCdp3E M3KiTtBsIt+X+hL9w2wvr19BVS7tv1wPUC1US3QTOBwGl72RXAbQua3eSEh8kFkLj1X2 j0XNjBvbgaumM+zYdJsQEg6yHbW4QEC1pwu9/+J2X5wIkpyRFhcl9e8rJiJMz4ACKMsI 6PRz8yb4cF793tApyhqp6TwKj0D1QwItIU4jD0RvstiR2YO5f58UWw27y7YCpy9NZCex OyOgfgp57w6roppJd7ZISbLhJ97qCPzukfOtJ+hrVupvD917Vx7puHgnC94c4F7XSsh9 B/XQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J7+9KYG2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1884-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; AJvYcCX3yv7KE9nmq/AKgbjCRcvZlbtO9DQ5UXCDCS8cx1ahHBoVuwv+qXwRwqeDfWEbxuq/nMWIxcWi7svXvVB1ubJJ3R7pxGt1v551n/uIlA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i16-20020a50fc10000000b005601f742708si702469edr.415.2024.02.09.02.17.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 02:17:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J7+9KYG2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1884-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8C2E51F21BB0 for ; Fri, 9 Feb 2024 10:17:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03ECC692E4; Fri, 9 Feb 2024 10:17:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J7+9KYG2" 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 BAABA67E87; Fri, 9 Feb 2024 10:17:50 +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=1707473870; cv=none; b=LDHY51G3nnsZWZ6cGw8X5O5omVkvtl4AG569M5GsWymxyEJ+yJjqgiIi48WZQ8W9o6dRwUuqhGfuZbximQD5UZp3XgRrVS3zC5qkyC3SKlRFjn+32LU0jxSBtwfai793Gz5GV7VsmMI4aYMazR6lFQBIJzOc0Cr4CEHKrY3looo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707473870; c=relaxed/simple; bh=xY37lD56+9JdYRX3k7Qva8TqE72lSWPSgLic4EbY6Gk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iVNUiaoVcc76x/Ddld+38yVnT+lSaKxE02ritY7gCoxgenRow8bg9PyXe8yz1ScOFfwwHzX9PXeU0NUMB4qI33hSCwDRLfZXBQ4H0T1BcCmvEWOaeu6L4YHkq8AY1FSEgf4bhti6SABVlRA9A/88XgKRWXbfQ1Uha6Gv+hFFcyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J7+9KYG2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 566D0C433F1; Fri, 9 Feb 2024 10:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707473870; bh=xY37lD56+9JdYRX3k7Qva8TqE72lSWPSgLic4EbY6Gk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J7+9KYG2oEfjQnmP30cpC5yh0acAX9F50LyOGTNhwTALt1myVzitm747OHn8ca0Sf WQKhLGgoLiRUNX9tx76W8sT1atqe7+hxTeQiYI5VKIC4o8KtJQqDvktjZLC4vAyQP2 rSBBlzvtspncVURhGkmbuxoA491aDu69wwXDJ5v4MBZmMDgPXIBLq53AFyBq23GltP B7xkn9hA8pGKPLiEXed5s9+4IY2UR4XgyhI6O4SLwL1vC2M12XEDOp+H+sVWnrcbdr f/TE0/RCZuxMnphI4Wuws36bdcrpO/V9KTLSY4l0vUMUd61iWe8oRRGB+jIHEtzXuK mdXdXITQeS73A== Date: Fri, 9 Feb 2024 11:17:40 +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 10/25] security: Introduce inode_post_setattr hook Message-ID: <20240209-warnhinweis-randvoll-dbcdc9d16c1d@brauner> References: <20240115181809.885385-1-roberto.sassu@huaweicloud.com> <20240115181809.885385-11-roberto.sassu@huaweicloud.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=utf-8 Content-Disposition: inline In-Reply-To: <20240115181809.885385-11-roberto.sassu@huaweicloud.com> On Mon, Jan 15, 2024 at 07:17:54PM +0100, Roberto Sassu wrote: > From: Roberto Sassu > > In preparation for moving IMA and EVM to the LSM infrastructure, introduce > the inode_post_setattr hook. > > At inode_setattr hook, EVM verifies the file's existing HMAC value. At > inode_post_setattr, EVM re-calculates the file's HMAC based on the modified > file attributes and other file metadata. > > Other LSMs could similarly take some action after successful file attribute > change. > > The new hook cannot return an error and cannot cause the operation to be > reverted. > > Signed-off-by: Roberto Sassu > Reviewed-by: Stefan Berger > Reviewed-by: Mimi Zohar > Acked-by: Casey Schaufler > --- > fs/attr.c | 1 + Acked-by: Christian Brauner