]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs,fsverity: reject size changes on fsverity files in setattr_prepare
authorChristoph Hellwig <hch@lst.de>
Wed, 28 Jan 2026 15:26:13 +0000 (16:26 +0100)
committerEric Biggers <ebiggers@kernel.org>
Thu, 29 Jan 2026 17:39:41 +0000 (09:39 -0800)
commite9734653c523c744f03333ece6ae7a315187f05c
tree415c025fcdf1a0231b59cd464a0ab35e2c11bcf3
parent63804fed149a6750ffd28610c5c1c98cce6bd377
fs,fsverity: reject size changes on fsverity files in setattr_prepare

Add the check to reject truncates of fsverity files directly to
setattr_prepare instead of requiring the file system to handle it.
Besides removing boilerplate code, this also fixes the complete lack of
such check in btrfs.

Fixes: 146054090b08 ("btrfs: initial fsverity support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Link: https://lore.kernel.org/r/20260128152630.627409-2-hch@lst.de
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
fs/attr.c
fs/ext4/inode.c
fs/f2fs/file.c
fs/verity/open.c
include/linux/fsverity.h