Linux filesystem development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: fsverity@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] fs,fsverity: remove check for fsverity being enabled in setattr_prepare()
Date: Tue, 28 Jul 2026 21:27:10 -0700	[thread overview]
Message-ID: <20260729042710.GB1705@sol> (raw)
In-Reply-To: <20260727094352.1734826-1-aalbersh@kernel.org>

[+Cc linux-fsdevel@vger.kernel.org]

On Mon, Jul 27, 2026 at 11:43:52AM +0200, Andrey Albershteyn wrote:
> The check that fs-verity is available in the kernel is not necessary
> here. Filesystems could have fsverity files even without fs-verity
> enabled. In that case, truncate on fsverity file will succeed, what this
> check is trying to prevent.
> 
> Fixes: e9734653c523 ("fs,fsverity: reject size changes on fsverity files in setattr_prepare")
> Cc: stable@vger.kernel.org
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
> Acked-by: Eric Biggers <ebiggers@kernel.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
> 
> Notes:
>     I rephrased commit messages a bit to be more clear.
> 
>  fs/attr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/attr.c b/fs/attr.c
> index 4f437fabb7f0..71888ac903c2 100644
> --- a/fs/attr.c
> +++ b/fs/attr.c
> @@ -176,7 +176,7 @@ int setattr_prepare(struct mnt_idmap *idmap, struct dentry *dentry,
>  		 * covered by the open-time check because sys_truncate() takes a
>  		 * path, not an open file.
>  		 */
> -		if (IS_ENABLED(CONFIG_FS_VERITY) && IS_VERITY(inode))
> +		if (IS_VERITY(inode))
>  			return -EPERM;
>  
>  		error = inode_newsize_ok(inode, attr->ia_size);
> -- 
> 2.54.0

Applied to https://git.kernel.org/pub/scm/fs/fsverity/linux.git/log/?h=for-current

- Eric

           reply	other threads:[~2026-07-29  4:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20260727094352.1734826-1-aalbersh@kernel.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260729042710.GB1705@sol \
    --to=ebiggers@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=fsverity@lists.linux.dev \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox