Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp816603rdb; Fri, 9 Feb 2024 01:54:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV86drQu5nlvEurwTtY+lM2P/C/xC6HxHwrwTSO+gHlA4XgEIHsZwxQ7pQViV14De93Fpzb/FS+D018ctH4FqVPVGxeLrRB8PZpPfJeXg== X-Google-Smtp-Source: AGHT+IHVmvfS7PmVHVQ5ip9V6/4WPQsJ+c4Feby566yZvTVjNWKuzWCpRKv1kNHZZAtH85r0MRNT X-Received: by 2002:a0c:9c4b:0:b0:68c:bf50:557f with SMTP id w11-20020a0c9c4b000000b0068cbf50557fmr865095qve.21.1707472464466; Fri, 09 Feb 2024 01:54:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707472464; cv=pass; d=google.com; s=arc-20160816; b=DjLau5lzaksgtOTLcah4/PTv3DPCgo9fALEW1qYg16QINDt/vk7p2XTGylxxPnC1Fc 6nBfU61X85WGEEouolzNwXgNmy7rIujHvUEyf02G0NnKwKtTOEHymBxZPy6E8Y7JiD9X GYZXIbpKonKCO4kCi3Z8NeKMTlmlJTFO4PYkppy0D7WTRltheYALqDONV5LQvwvIBuMR vXqYgS5r5rdJULuIgSaCR81jmg5PaHQNYomCrFJQrm+D5UUPfPWZpE9Jq6zRSgTwrxgq TLFnvFGsevyB7OG0n47LYEP0N85XWw91/iyslceALl0zyFBBQRdZ3ym6LZdDQIBoKoL5 DGPA== 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=sk8E3DQ1aXGJcUgbYu99PGj0LePvKQo/SZuuMiqS9C8=; fh=J31utSy1bO5CXAlHDQYMdp/nZNLGhjpOtimPzrxc+xM=; b=pCn+4T6L8cs0YU+/njxr+uTxVvsr2axlLVGTvOjWtijsXM5e0kTU3Ht4Y/HDJ/IAcY +GmizEdCMU4cudaJSYJnnAeuUVn1TJbZAlPtHaE8CFlRjTQa5ckU1hDZ+FtGNLJjHBs/ pM2BoWz5NFnD7OotbNIBkPD3vutz+c9B1pinn2OCpzQHsJU2HlMZwXEwa77FqXO+L3P7 PXxMslJA61vn2T9R79gVv1PPUUqopefx4GCXPxplwjbvzSpVlZQVrsMIDk518M5x8qJ2 ljLF5dWGQTdPpshRQZcSASX0HanT+UOViOot32MCa9d/PJWhkz62zHmF0e58jhwbUSBS qp5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kL4I8I47; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1878-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; AJvYcCWrikATxBWt7K/l7gL7Chqwdltxw04jWR/r4ks2p+Fan1ZW+gMHTg1/c8DYClJ2RV76dyZRbdSzR36IZOqprt5tVufTqrMK+pWTodhELg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jv1-20020a05621429e100b0068c78ada5b1si1498833qvb.223.2024.02.09.01.54.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 01:54:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1878-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=kL4I8I47; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1878-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 241291C228DA for ; Fri, 9 Feb 2024 09:54:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FE2267E65; Fri, 9 Feb 2024 09:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kL4I8I47" 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 3DAF6664D6; Fri, 9 Feb 2024 09:54:19 +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=1707472460; cv=none; b=c6YrVaTLJlrs0ij461ns1nIuM/bG2nffo2b3OgKMmuEzpBsk//VSdbm5CPj/z3YS5pe7ngwL9R1mrE7SnWg1V66HuGpEivB0qT+qIWp2kui3UF3bzD0hF0pLAeh0S7ksBw87Pi19mcGnVUK3A4ZhNjKQni8MvxrA1uoSqyIpc6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707472460; c=relaxed/simple; bh=WwEoZgYHzCrxC+Km70vhRbnfNlWbuXqwpjdl85yjWkg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qKNxQYUbcHhKRmWNIPawO1lIN4PIYskV+2kOcxGjGLdH1NpnjolfQUGXWS0qkZ2JQM9LqQY39X2mwh2jroTe71ZdjfsbkRZcl45sc7yp0qQlk3lw1QXMp1G2Xb8h8ppZdBANaWzSawsxJFhBkZICGmH9JYW/Atvn6VA3/m5BIUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kL4I8I47; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B9A7C433C7; Fri, 9 Feb 2024 09:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707472459; bh=WwEoZgYHzCrxC+Km70vhRbnfNlWbuXqwpjdl85yjWkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kL4I8I478ey5Zpr0mwB0vmii6U2ndGcbowcZKIAfgbNu1VuEuGy5WWefiP0ipdWlT iQ5Dn1xlXBBWSkOu5nACHA/xjeQEexJ3xX0vvh/SVp9dNwrLvFLkFMLlqZE1iy2jkV Isg+5491MeO0UpiN+V8DXV4yvINPZylgkOw9MhpjTDKpH2+fkXheyEjqipqRQEZW1g cLY9mA55fgnOuj4jZPiZZ652HxbScbM/8ubrBAHEOJP12PqKsxvlR2+Ntww5bwsOtg ixp5MK3xm7vFwKOjTlYKLKH/fNvvMvEbbTLRWsI8giJPTUsaXs8ifACn3VesMzlA3o hju9LDkTLxj4Q== Date: Fri, 9 Feb 2024 10:54:10 +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 Subject: Re: [PATCH v9 14/25] security: Introduce path_post_mknod hook Message-ID: <20240209-warten-anstreben-54d2c519fba8@brauner> References: <20240115181809.885385-1-roberto.sassu@huaweicloud.com> <20240115181809.885385-15-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-15-roberto.sassu@huaweicloud.com> On Mon, Jan 15, 2024 at 07:17:58PM +0100, Roberto Sassu wrote: > From: Roberto Sassu > > In preparation for moving IMA and EVM to the LSM infrastructure, introduce > the path_post_mknod hook. > > IMA-appraisal requires all existing files in policy to have a file > hash/signature stored in security.ima. An exception is made for empty files > created by mknod, by tagging them as new files. > > LSMs could also take some action after files are created. > > The new hook cannot return an error and cannot cause the operation to be > reverted. > > Signed-off-by: Roberto Sassu > Acked-by: Casey Schaufler > Reviewed-by: Mimi Zohar > --- > fs/namei.c | 5 +++++ Acked-by: Christian Brauner