Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp826768rdb; Fri, 9 Feb 2024 02:17:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHn5IIYTTVO7nnLr1Jujlu4NRUIQbGugTulfWX9Rec/osvFPU0MGRpX2+zv2pedsazV9cvK X-Received: by 2002:a05:622a:14cf:b0:42c:424f:aa63 with SMTP id u15-20020a05622a14cf00b0042c424faa63mr1354324qtx.55.1707473842412; Fri, 09 Feb 2024 02:17:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707473842; cv=pass; d=google.com; s=arc-20160816; b=Te08u3Ncg0aMTfq9W7W4yvd9G9zp+TVQ2Lsav5ILBpou3LKeJQ7Ip70Lx/o5tSDdU5 7oW8wr9mR+VW3S7fwEV5W58I+cOdUR6ZccboKNyyGts9rdvdhG8Q0yVt7HouA8QVU0bY PioLPiry2WDjTMiV5/2fCADtXCkg3dE0Y2FhjhJnTChENTfUV5PFjqF1mV8m7kCDi6XD vprFzY6oB6SbQP49LtXY6sk3K01eEJs/X9HoyzgeuH10hMrTfdCDf8EDdAO3qDmnqXn+ IOLBtqHEXM3joqPf6ho7hRskzeEJMSIHbqtKHKuZgHZJAO4pEx4i76+mdXfA1NQ2kmpr IeNA== 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=pACQFxAtfzVnqy+Bq+rEcM+LkCit792iWPRbThGbRW8=; fh=cSIOYggrwAY2uY1qOBeLD0Q+k/tJjo6rHYLLGabxlOE=; b=FVC/Plw+6G4aRFK7fOyAqThUtttJZ5XxKKubKUQnSf1+GnTWh9F2rkZdRdgZzSsNue rlboCYXJef7zYtzrevdjPoo3EEkGJw7iDoiju1gFKWSHjulu7seQH8Ucl9l549IVCkn/ r2JTaTaHr1qoSx336iFUtMacURibQ0QaHtw2+R+VDINahxndKpv4YCvq5fGjyviSKOgN Ph1SeUHOBtrw1yepafx2UQJawZErERpmHVzfj0CerPr7ZZL7WJh7490KgDglc1JbiNK0 lVh/UqfuLjExGk8lkuJjIKTdHht0ypuLYZtfYyNInxN4eyLQxQ8L39bJi1PT3pGsF/RK Qmww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JXeWNxL0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1883-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1883-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; AJvYcCUW3x+ZJMHCdVo8V16mJeUXGU9zDUGYP/RqqyoquzVZlEM1OU51H8GcpmmJWZvJAo3oSLnKmm8q2SP9pC6aTqrRCHG94XlJ+h7Xfkdnsw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p13-20020a05622a00cd00b0042bede995aasi1514871qtw.516.2024.02.09.02.17.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 02:17:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1883-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=JXeWNxL0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1883-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1883-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 2E26A1C20B78 for ; Fri, 9 Feb 2024 10:17:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 952CF67E99; Fri, 9 Feb 2024 10:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JXeWNxL0" 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 541B5692E4; Fri, 9 Feb 2024 10:17:16 +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=1707473837; cv=none; b=X8KpcGkD/jEU25p2OsFDZ7rxbFk7hvq5wh/1N75Rcty97prnvHrNNc4kLvJYxQ+bOKH6PlJksc1DzaIRUe4VyqbHPTHyNClwKgnABExyaBK5hJ+xsz3vLHcbLLGoXdC1tR/0zIImbc1EgYpfcckip/CrBGmDjM3aDQ3b9F9ZaAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707473837; c=relaxed/simple; bh=Fb/idb1jz16Rfwn5+L0Y0UqFwZm3zkyH93zlAJfk9p4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ftkwYY2n2pzRfqFK9KAOoS2zsAzyEchuaLQ2LKAxWK4DSCcHWV08HRkyJ+iZ3ajUKslY2WLDafm9JeOyZh+cAfro1c4z6DN2kNVeFemXNKdRKE0210YhRrbw6pvikJqfauC+FLEN5lGSeAc2Bv+rGuvCJjN6P1moif9szlAe1A0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JXeWNxL0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED705C433F1; Fri, 9 Feb 2024 10:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707473836; bh=Fb/idb1jz16Rfwn5+L0Y0UqFwZm3zkyH93zlAJfk9p4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JXeWNxL0zUSn9gVGAMLAsbZxf6W4EM3dHfLVD7WtOXydX3R12UF+V+zQbBodsaZjV FbYBzG9DWy7rmYdmS+UTW8Y5Ko/gcae75z1YWiEIYaeUJwir20tSXTl++hOyAfISLN /AqHuA0VV6STaEsj1P2N94U/wjsjsDnrEossfROJ2hhi8xGYyB99LPeZC7dP58uvAD t+ozFILhnLWzhxnwgGBQK9C2kBhAeHQaC0dOIvPmcPk1PC0eJ9MC6yVWdcHS1az8f0 8Y/wO4o0LnAyqElp10fAujqHa7wXADfhWUxhF6tYuwrx4SfaZLYH2susKFIpoZ1bUQ JogAqQSRMI7Ew== Date: Fri, 9 Feb 2024 11:17:07 +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 11/25] security: Introduce inode_post_removexattr hook Message-ID: <20240209-kostprobe-herzkammer-a05406383e80@brauner> References: <20240115181809.885385-1-roberto.sassu@huaweicloud.com> <20240115181809.885385-12-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-12-roberto.sassu@huaweicloud.com> On Mon, Jan 15, 2024 at 07:17:55PM +0100, Roberto Sassu wrote: > From: Roberto Sassu > > In preparation for moving IMA and EVM to the LSM infrastructure, introduce > the inode_post_removexattr hook. > > At inode_removexattr hook, EVM verifies the file's existing HMAC value. At > inode_post_removexattr, EVM re-calculates the file's HMAC with the passed > xattr removed and other file metadata. > > Other LSMs could similarly take some action after successful xattr removal. > > 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 > Reviewed-by: Casey Schaufler > --- > fs/xattr.c | 9 +++++---- Acked-by: Christian Brauner