Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp816365rdb; Fri, 9 Feb 2024 01:53:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUcIlCD7BQMKNf2sHzMvTICErHS8ZSn+j0zwE7kt3AS/G5f+bXdAC0rJel63TPgZEfrGJOAGGWpZzcAdBWFiCdlh39dtI6rhGA6DxUU9A== X-Google-Smtp-Source: AGHT+IHMR7WfY39K+kdPWWMtbxsVhcMbTvKzTw3UuZRDqWu8PpLYEHvOIciPbTwj7e9pociBjg8E X-Received: by 2002:a0c:dd14:0:b0:68c:bb63:5fc1 with SMTP id u20-20020a0cdd14000000b0068cbb635fc1mr969835qvk.53.1707472414850; Fri, 09 Feb 2024 01:53:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707472414; cv=pass; d=google.com; s=arc-20160816; b=FXlBPc25YQCgRwSWOQTf8L1xbRpTQamJDyfAswfZ+JmrW+lsV32NtvDlIs0p17Qysj d+HP6apvETRrqSwLmpv6N1rjJuTkMyxg9xbbpXnOLm9MDSlXnbj/Iw0WmWaNUa9jCR4m T1SJTC9aYUSWLFoCoiSN4ho3zDkkvx4t08iE6x0TH0kqNNugKQc4Q+FMj7Ubh09+boU7 /mAmPpkotbeik/jwZ2uth0HR77OITWU/3gZSR2RYRv92qu0Dhz4+S7M/MMGHJnbrvM9E aRR4VvS7w+rrvfcJ4pwQFP5wCue7R/y1kDUGfsJYsnz9CKJnsEyoF9GUHzRpybVFfx58 2aEw== 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=Pr4HPNWqyPLfA2s7M3xPVo452/9Et2+1jpAHAR565Kg=; fh=Mtk2bLlwihjQcmOfnxwcr94IGrsKByYoITPHCp2tHP4=; b=q50giU63G7xacaGbrywEC9q18KylOUXGbsYMVluPgtj/hgyOzzFrIrq/Cr7AtWTsJK d+GwS/pvdDEav/TRddIXbBZ3JdonuoYi/wXHvWvtCiyWQnCvsiC6+lc3zSrpiIU5BDuV 6nAwxaqG7XGjPq4SAlIomBJ5sCFoqkDLSV2ZAzUc1/61LVxr7niNWBYk3PIL1U8yzVZK aw6WphRVifP05c1hKxVuzEZgcL1MthInj6sEPHzZj18MEar3p6fn541/c28ZhcBl4s6K p8gmh6AFodxmFm2TZWj1Sfb5/9WfUbNFTqPuIR8DGAe6Lg+1Ko0vDuLrr0DVhtPdNjvI GyAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uoTDYUtU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59182-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59182-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; AJvYcCUzfFBMoFsJP6GlDgD8rDLEiYAgYzJvw1s0l489p4BH2hzFjDP30nP7BEj+UlT2Y69fK2LN9xHpFKc05v4j30k4D3Bc8KKNAM0ghWuj6A== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gi6-20020a056214248600b0068c7d55794bsi1610212qvb.135.2024.02.09.01.53.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 01:53:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59182-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uoTDYUtU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59182-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59182-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 96B281C229D4 for ; Fri, 9 Feb 2024 09:53:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 960A569948; Fri, 9 Feb 2024 09:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uoTDYUtU" 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 9EF1567C44; Fri, 9 Feb 2024 09:53:13 +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=1707472393; cv=none; b=lD+bJkUHvKCx+lE//3Gh/P13RGgED/ULddmybh9jpS6e+YinjLF+c7AJa26YFoEOXD39a84Iqlr2q6zOfExx7KoHYRfIFzo4HQRAjJjXtNQjyys/ttF5IcwDTclj2ptclhGYXTSM4tp2ilDM+1HdxCWE7/qq5buktd5+1RWEMpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707472393; c=relaxed/simple; bh=F50zsa6+e1nT6wsZ6cj327oxGrMmpGb9BWm/DkP1WnU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y4OICCJf3xrpzMWRFfbIIsTy4ISG2NZIdma+33X/9ItgMb5KFEJRu8ezK5+zsTgZbUgg7HE9XtF3pF/zOt37Os2uicrSTqvcDTkoEKRQnP5F7QL5rvirWBLX1ReNb8QEwfDa9AfiGsebJzsviA8EXnAnrbYjeXihQjU/7z+VaSg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uoTDYUtU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 337F1C433F1; Fri, 9 Feb 2024 09:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707472393; bh=F50zsa6+e1nT6wsZ6cj327oxGrMmpGb9BWm/DkP1WnU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uoTDYUtUxBndQdOpPCazNAq3SArSxLev3LxKei5G1B78NIR1YF+TdgjHCk7S6c/Hk V65ct7ks0hFg3wICAnRw8LvzayLRwQ67fixRQVikFKFbKsbUfKRP6zwcq20jj/raNJ ozl8BsB6HJX0svwVcwYort5In6dW6i6MB8CcGhqT7KTvCr1kHSKaZliwvtk/nmpAYY AEBO8jBBzOSHv6S11SERHAPvmOAcb4v+3/vYAqPiVEE22AFBXk9SQWs4G0KG4bVzoM 9sgOAjU/HK2dW3iJ/GAj8aSOEGCl9Yp5iOIzA8vTAlwequEteblg8ybM6OCXNT5i+t yKT0/7wjB3Buw== Date: Fri, 9 Feb 2024 10:53:03 +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 15/25] security: Introduce inode_post_create_tmpfile hook Message-ID: <20240209-vorsorgen-desinfektion-0abc435eec43@brauner> References: <20240115181809.885385-1-roberto.sassu@huaweicloud.com> <20240115181809.885385-16-roberto.sassu@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@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-16-roberto.sassu@huaweicloud.com> On Mon, Jan 15, 2024 at 07:17:59PM +0100, Roberto Sassu wrote: > From: Roberto Sassu > > In preparation for moving IMA and EVM to the LSM infrastructure, introduce > the inode_post_create_tmpfile hook. > > As temp files can be made persistent, treat new temp files like other new > files, so that the file hash is calculated and stored in the security > xattr. > > LSMs could also take some action after temp files have been created. > > The new hook cannot return an error and cannot cause the operation to be > canceled. > > Signed-off-by: Roberto Sassu > Acked-by: Casey Schaufler > Reviewed-by: Mimi Zohar > --- > fs/namei.c | 1 + Acked-by: Christian Brauner