Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp20003rdb; Wed, 7 Feb 2024 19:23:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVgUWa0WBK4QcBc0sjB51hAseaPda5wYr70m4ibq1dT0yFWx9yS0CSJmt0irqsAYvs6PAnkwdZQwy6QLp16nfkrHNM1GMo1D2e9Lyz2mg== X-Google-Smtp-Source: AGHT+IFsxcFNWxiVGEtMMlCwVzvEcfOotnnNB0zvV0lpFdS5f52soHa8VKMknCQybgV5h5uKV/ib X-Received: by 2002:a05:6a21:3383:b0:19e:3c51:7d37 with SMTP id yy3-20020a056a21338300b0019e3c517d37mr7694855pzb.8.1707362630828; Wed, 07 Feb 2024 19:23:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707362630; cv=pass; d=google.com; s=arc-20160816; b=CV9wmeZm666qn5rYqGfolLjsFrfvQWZNlocgwQ8CXt/shUZ5yprCMfOh84piuBSnH0 6pxuGbb27Zs8kBmSzMv+Z0pqKP2ygNMaKAyghY3RdCtjceX0jZ77PmzzqA3xbiunwrVP IybQGYuxy5lCm+/sVUSiGni44xvBp1oIwUlyIGGyp6tC7x9rNJTYudBsIW/1Vpz51mVX 5MKuzi4BhSfNVY/gqkZgjzUFAoapALP/ZoVEY+TyZ7gsUCMgZ6tvVRLT0l2VDglnNiiz WQrrKV6wjtbmmG0EkHrkttt6Wq4alxRDlu4dE6tZL3dB9oZ4qCZ+2C0gf2adPzF/i0FV 7t9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date:dkim-signature; bh=8ZeuYHwDTViLa8vRHQu+TwTZjS19Db+fh3Y1+BuGrUE=; fh=PQSaWSB31rtkPraquNZ3hxzjhzntL1YEg/uV9+QJAB8=; b=eGQe5Y+3ngkLHy8ydMKUKdnnH0eKIpwz6YZymHo9W2+QnUEv+NtEIvfq2VwrPs1wKL JxH4JhUBz5GbfCgcRrAqr/KBJMLSAKOrecoZfdYv0+44co4xXJn0heY9El74JNjI8WhL T03sqDSxxWPm66W0rgiQlRWzAomRtjImjesk1BUfJOXaqf4LZkKjVFJx2Vw9/byNHDcK OXXSZephfZ+PBZSoA0RcbCrFHv2idQBWh+C4PHKbw2DJyXqjeP+XtJczaGhocrjLPWdK X4cID2QaSc7X5Y2KyAg5OU/BhApehBOr2U8nblJd8Nx7PyiSP3YrU+fCBeVNs34mXQEc l39A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=CckRshft; arc=pass (i=1 spf=pass spfdomain=paul-moore.com dkim=pass dkdomain=paul-moore.com dmarc=pass fromdomain=paul-moore.com); spf=pass (google.com: domain of linux-nfs+bounces-1840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com X-Forwarded-Encrypted: i=2; AJvYcCVl7RltQWX2SyV7fffGIuU3vFAO6XYueE7rhRWa89VPlH5TxurzrOp1pKYdjn7yXCKHweaONwGLUJ6hiAXfJ7r4FZETRfmJjstKGA+v+g== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x6-20020a17090a9dc600b00296870d1670si365073pjv.113.2024.02.07.19.23.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 19:23:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=CckRshft; arc=pass (i=1 spf=pass spfdomain=paul-moore.com dkim=pass dkdomain=paul-moore.com dmarc=pass fromdomain=paul-moore.com); spf=pass (google.com: domain of linux-nfs+bounces-1840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1AB02B2431E for ; Thu, 8 Feb 2024 03:21:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D133E1DDD5; Thu, 8 Feb 2024 03:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="CckRshft" X-Original-To: linux-nfs@vger.kernel.org Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 811042D044 for ; Thu, 8 Feb 2024 03:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707362327; cv=none; b=k1AZGI+hNkfcuJpP30cySZpqpnZTff/o1EEk70OpzLX/R/555dSMtUS7lMYtkojQVSzEUGHqdVXTlc46Bn0FVF1+HdZvydga6EPYlpQHmBtSpwGoWjodD/57btKcCzdy3UEKhU4OwAQM6QZaFLxr1+DzdP99InXapRE8cnlSL4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707362327; c=relaxed/simple; bh=qUZDZYdcOVyNAYycr8p0bXQZRB4zjl1lrkTSLJknVNw=; h=Date:Message-ID:MIME-Version:Content-Type:Content-Disposition: From:To:Cc:Subject:References:In-Reply-To; b=qfMF2t4op0Sm8K7TRbH+PikiYG1tQNma1kB4Zm0BKq79lUQI2nSHuAjtNDXwMrMkeIOmaywF5Yh1gzeDqZCwpJmDStd9+IcnL4jtYIXLsCm6GvQ2vXWSHBPsnvlPABEgayFbnfxAWXlGS+gpW3X5Ei36U1eJD0zmniR+vT7mRak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=CckRshft; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-686b389b5d6so5607026d6.0 for ; Wed, 07 Feb 2024 19:18:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1707362322; x=1707967122; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-disposition:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=8ZeuYHwDTViLa8vRHQu+TwTZjS19Db+fh3Y1+BuGrUE=; b=CckRshftgxsuiAC+M2ek53zQ9OTCYQyT9deqh8QOSMRm0aTQa2ViPunx0zwxPcw9UJ hh6AUvcfNmi+4m9yj7S/Eh2VlJ6TTO1qy3aIsyNlYBaUrErqI71wWHoUfh62CzNbBS/6 GIfcaMn3wWQEvCcd3TTqTNQsk2v8Xw/utSVSYldzisksu0qpH7PTbEOwOkAyRHJ70hdc xdCN3uZcX5Tu+Obu3uCGf5XTk94T6+YWeY1bjLVU8BQtwOBRSmjr2Jv+0w6ThF9hk3yB yXGZIz9ORP+DbewZuNlg9Y0HaJ23p//PeQmQSc5AOui+dp9e1/5Z0Rae/hT7G8PDHgnT mQXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707362322; x=1707967122; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-disposition:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8ZeuYHwDTViLa8vRHQu+TwTZjS19Db+fh3Y1+BuGrUE=; b=wVzynINev22MBmUii/RxR5uVzOT2Go6b6JcruCwy6GwnZd3aJLiRvAa7sE48TVU8ek 9ZK+cXC/n+ePo1ww6j3r53JSpexuCW0zteWhFGVQsOZUf64vAajY+H3ZRyHtxTIcOgG5 v9nzLjWBkxxadYB1FJNUoOYZqCdKqpR0T4zMWPlavs8xnUHNYbvKrJsrlIE9TPeHrhmO gOOpu5dsWM25kWbf2aehiyjSfEBCcSzUrcBfhkHXeMqGnZTUGiKoLPciawjVH3582u/D IusSCRwZduWFKlDXqZrFAqR1xkEhuouPuMp1MgJHW4jjQwoXTCWoXqeIkxX3kZv9ttg0 nftw== X-Forwarded-Encrypted: i=1; AJvYcCVNmPrsEvgK2FW7n8/lzvl9KGCLCfALaKRsTGN5TD1G2v1UCAvb8P+gali2gn6+HAaBAow7lEjEnYQjToCkpcj1caEYpIp86P7M X-Gm-Message-State: AOJu0Yy4GWhbzQN7YTfyrwLNmMp+Dj3LPduc/hMwIhm9U1bg6h3TYz2N Yc9HuODv19hT7H50uSl8j7jkNHKVe/gQbna4Ydta/rqHrc02PBx/tdWhGW7zWA== X-Received: by 2002:a0c:f5c9:0:b0:68c:68bd:b724 with SMTP id q9-20020a0cf5c9000000b0068c68bdb724mr5886949qvm.4.1707362322287; Wed, 07 Feb 2024 19:18:42 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU2IFuzewHpOKoXct9biVe9fWJEFffQvwxzMpaN1wh+C/EnyyepGQBPLjp45QoGsjpyirjMktBsMFeDf6NW6o9Pr2idgN9X96q6u6e3DM3H5me7IwzUq/ipNM/QwS1aSWYi3g/t12cwEC0Q8qzY89IYK3dLa1jrEwjM7OMfXILsgci41LWkT5ZRQU6wdshoksbhiTaqQ7IW/mdsqx/kTXRVwVEQX/19e/T5wYZSCezGU0M6gL+Hhfa4fsHAHdGDpLOjkPeKkM52pcIz9pbSMhnyPgDvWKrb4YcWQGI+4twYhExFQZWCQjMp+lc0qpZ2LYsP5RkFaLP1z1MR+h0nb+Lg4T8QJRrLVv0RRJobApHCn6qRe3FNzXgM2gU1GtbvVU2eCX79XY/83uEQR1JHgHaUurCCPRscWlwzpQmfNjGdfj6Y9F4eGNU9fjGGnxjuBMRBcqqQqKmOyK2B55Z63c2brzpgOijagpTSP+QKIBbN/f6XmGA7t8ZQHLlUXni5XzgZu2FQIgcU53BrtwmKXuegw3dlFQ4Sswt9NFQ5xASS56zyD68ZrXmUbUFaNi4Gd7jAafkUD3JRXPmh6yRBbV8BWmeV3brLN2jf845BXl8GvX8mUowsiLKf8MXwp1Lot36skDUC94fjl1g00hjQfJOoLp3mhSJkAlPbQzBRRdoFuIogtk/PpHsx0vOsHD8AjJ1K2CJZDj+jq9ad+KrZL7TqzIJXL9XB1QCuBnKAjaaW4/+qn5WKLhALEs2kuyhYJzVfTwdlYE+btVT7Wn+fdc5wE2L7KtWaS+skXLtfT13HOd+Iih+aNYi5OwgGZMuFmzoMSIUDcXgMPKFbwqkG9ThgcSTO3eVaH/zLJiNsMD2rZJzo0ok4yTMoSL/gtKrfOI7xQJ+nolZAQ1W3wUnX5wnkDh0fEJi1yrkCExvuvQ9HddPpUDnMbUfXnihNzhQciGYsH8 EculpBbu/6nEY= Received: from localhost ([70.22.175.108]) by smtp.gmail.com with ESMTPSA id nh10-20020a056214390a00b0068c4d8a9dcasm1171654qvb.140.2024.02.07.19.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 19:18:41 -0800 (PST) Date: Wed, 07 Feb 2024 22:18:41 -0500 Message-ID: <512191c5fea825fa2020600807a6816f@paul-moore.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 Content-Transfer-Encoding: 8bit From: Paul Moore To: Roberto Sassu , viro@zeniv.linux.org.uk, brauner@kernel.org, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.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 Cc: 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 References: <20240115181809.885385-11-roberto.sassu@huaweicloud.com> In-Reply-To: <20240115181809.885385-11-roberto.sassu@huaweicloud.com> On Jan 15, 2024 Roberto Sassu wrote: > > 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 + > include/linux/lsm_hook_defs.h | 2 ++ > include/linux/security.h | 7 +++++++ > security/security.c | 16 ++++++++++++++++ > 4 files changed, 26 insertions(+) Acked-by: Paul Moore -- paul-moore.com