Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp33686rdb; Wed, 21 Feb 2024 16:08:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVBa1F2BeVTxIVrj0CEoOXjU8ukTPUvXxB7Dl+BBHri3FNENBeuUz7Yt+Nu0YPeMNwE9xqnTX1pmsfX779A3W7cZS7pr8wVrgHCB+8q5g== X-Google-Smtp-Source: AGHT+IEi9G3s2nRAQGwhOI2UW+n9tL1iQAYjkCowDeAk5GNihEQqIwoVVAfLRiwn209MBuJL5XQT X-Received: by 2002:a05:6402:8c4:b0:564:140:f760 with SMTP id d4-20020a05640208c400b005640140f760mr8653149edz.41.1708560497659; Wed, 21 Feb 2024 16:08:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708560497; cv=pass; d=google.com; s=arc-20160816; b=fPwNaRymupR8nTz677+aTqccSjcgKmy01lcncbnPM2lEpNCZnUpKVyuLwp8SL1NxDz rAoIr9iC5p97GEflFfu4wuxo/xqqaguDtX1nIyNnCoH6u0zy7+F4Zq4v2xWDXfHtAof3 u81nGegDZMZRGSlh9OJ4NJqv/P5A7hiAA6jLlI/aRUjSttJRb5nAYiuJny8G72QOM99t FoXr3WobHAkPCTCZVaVaKrn1uJ/BZGcKK8NVpFPdEb/R0LnXq1yNJWVSU97IQQZ3Zjyo 4/NqIaNs14rXygNPUsDCGmOkUBfMQDqakWzotRQauupngKe0dahBc1nFQiT8FcjB2+R2 nQMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r/CjVOFAkJcm/BzXBPfKG6ofAOnHe+of+EJstADbICA=; fh=EzATVX8pnNokhAQWwBZNNKko/nTsiJ3PsvxHE99Bc8Q=; b=WbmUjYYfyA64PhbN637NE8mm0soGHFS05XYHZTmUQOoYshWADufjVYaFfHrj+770Fq 99UY+hi40ZY1F3PffMAvCRpPYsxUSqxRwVh93ghB+azbFn7lmlU7gWCQ9JGacO5RPEfi QqwovnaxAnqsjYeXGvFeINQqGYtE8uNwdsRLSE9YBU5BcnjWLn+Fu7wZ1t0yUQiebluS o70a2GQXxAIr4MBKtKyPo70CNgbs03vIZDjCxMMSnkLhbJmQ/V+ZjnQ3UKtB99b+4MSu HRyfQwRdJrGRk0fZMQH7AYkfLlay0eMgb1CWB7OZyh5vxgNyjtT0P0XJZFVxo9P8tlVm Nifw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y42VscKr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75700-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75700-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q15-20020aa7d44f000000b005646cf7d4d9si3414927edr.269.2024.02.21.16.08.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 16:08:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75700-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=Y42VscKr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75700-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75700-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 6A47A1F23AA2 for ; Thu, 22 Feb 2024 00:08:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD0F98BE8; Thu, 22 Feb 2024 00:08:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y42VscKr" 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 C27331854; Thu, 22 Feb 2024 00:08:00 +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=1708560481; cv=none; b=bighMFvtnxScIe9blMRrySrupue9zM9x8WAQFRP4nB3hIbadegZ4hk9Ia3jG0UFuRjMJrJ/Qgn/8dDrAHetzaF/bNYo9v+6o5DVEfS26t377BRgBa/1TPWh6MqWOfAxt1QG/C8OenzmFHLfVi6sMfDVeQ3eWsvTMCwiLoxkZuow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708560481; c=relaxed/simple; bh=vE8G0tEnjCDvKYtM1hAj6g+Z7bZNowrFZogG32m/K70=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FDpZvRKAXUTBXQBGwzd9zjJ7Y1eK3EPr2OpFFuReeIZ3TIkqLVUpTuoCPJxPq0i8twmEF3uvEi+2XKtUB4/3LK5mM0gXXSqpe3mbw22l8ggW07DuzgjzOVYzAzBCCFED8m92YK9mhUvhw47yiQ27b7wPXgF7JF8ZgezhG4YOo5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y42VscKr; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DF65C433C7; Thu, 22 Feb 2024 00:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708560480; bh=vE8G0tEnjCDvKYtM1hAj6g+Z7bZNowrFZogG32m/K70=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y42VscKrvxtAeYusTRWD6nCdHe83JpVE4gTfo6qOWzSr35vqn+d3jY7Zw5IcL0vnB PakgDEDQ6OPmTo0AK9gFPD6TJx3p4/8JJPJFk4lV1V5VLRgjczH0cX15H6dfnlWs19 w9A5I0t+DccGyh5nE/w3d3RJxsfu3btoZCd1VpBOA8jebEHWFizMP5AWg0So7quzxy QjGE4Tti8547FKVzZGuTljGQDc+MGukbKyomzjNKeJn1tK8sY/PgOiEivvyH+Ww0bn a6KlSCCFCx5aeAWxlgoHf4bXLz8WtZSNJ8rbHPmwW6S9h1/qML7j6TvG6WBPb5Dara Fq6dZETVqsoFw== Date: Wed, 21 Feb 2024 18:07:59 -0600 From: "Seth Forshee (DigitalOcean)" To: Paul Moore Cc: Christian Brauner , Serge Hallyn , Eric Paris , James Morris , Alexander Viro , Jan Kara , Stephen Smalley , Ondrej Mosnacek , Casey Schaufler , Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg , "Matthew Wilcox (Oracle)" , Jonathan Corbet , Miklos Szeredi , Amir Goldstein , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, audit@vger.kernel.org, selinux@vger.kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: Re: [PATCH v2 11/25] security: add hooks for set/get/remove of fscaps Message-ID: References: <20240221-idmap-fscap-refactor-v2-0-3039364623bd@kernel.org> <20240221-idmap-fscap-refactor-v2-11-3039364623bd@kernel.org> 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 Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Feb 21, 2024 at 06:31:42PM -0500, Paul Moore wrote: > On Wed, Feb 21, 2024 at 4:26 PM Seth Forshee (DigitalOcean) > wrote: > > > > In preparation for moving fscaps out of the xattr code paths, add new > > security hooks. These hooks are largely needed because common kernel > > code will pass around struct vfs_caps pointers, which EVM will need to > > convert to raw xattr data for verification and updates of its hashes. > > > > Signed-off-by: Seth Forshee (DigitalOcean) > > --- > > include/linux/lsm_hook_defs.h | 7 +++++ > > include/linux/security.h | 33 +++++++++++++++++++++ > > security/security.c | 69 +++++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 109 insertions(+) > > One minor problem below, but assuming you fix that, this looks okay to me. > > Acked-by: Paul Moore > > > diff --git a/security/security.c b/security/security.c > > index 3aaad75c9ce8..0d210da9862c 100644 > > --- a/security/security.c > > +++ b/security/security.c > > @@ -2351,6 +2351,75 @@ int security_inode_remove_acl(struct mnt_idmap *idmap, > > ... > > > +/** > > + * security_inode_get_fscaps() - Check if reading fscaps is allowed > > + * @dentry: file > > You are missing an entry for the @idmap parameter. Fixed, thanks!