Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] fs,fsverity: remove check for fsverity being enabled in setattr_prepare()
@ 2026-07-27  9:43 Andrey Albershteyn
  2026-07-29  4:27 ` Eric Biggers
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Albershteyn @ 2026-07-27  9:43 UTC (permalink / raw)
  To: fsverity, ebiggers; +Cc: Andrey Albershteyn, stable, Christoph Hellwig

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs,fsverity: remove check for fsverity being enabled in setattr_prepare()
  2026-07-27  9:43 [PATCH] fs,fsverity: remove check for fsverity being enabled in setattr_prepare() Andrey Albershteyn
@ 2026-07-29  4:27 ` Eric Biggers
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2026-07-29  4:27 UTC (permalink / raw)
  To: Andrey Albershteyn; +Cc: fsverity, linux-fsdevel, stable, Christoph Hellwig

[+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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-29  4:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27  9:43 [PATCH] fs,fsverity: remove check for fsverity being enabled in setattr_prepare() Andrey Albershteyn
2026-07-29  4:27 ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox