public inbox for linux-f2fs-devel@lists.sourceforge.net
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] fsverity: add dependency on 64K or smaller pages
@ 2026-02-21 20:45 Eric Biggers via Linux-f2fs-devel
  2026-02-24 13:55 ` David Sterba
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Eric Biggers via Linux-f2fs-devel @ 2026-02-21 20:45 UTC (permalink / raw)
  To: fsverity
  Cc: Eric Biggers, Arnd Bergmann, linux-f2fs-devel, linux-xfs,
	linux-fsdevel, linux-ext4, Christoph Hellwig, linux-btrfs

Currently, all filesystems that support fsverity (ext4, f2fs, and btrfs)
cache the Merkle tree in the pagecache at a 64K aligned offset after the
end of the file data.  This offset needs to be a multiple of the page
size, which is guaranteed only when the page size is 64K or smaller.

64K was chosen to be the "largest reasonable page size".  But it isn't
the largest *possible* page size: the hexagon and powerpc ports of Linux
support 256K pages, though that configuration is rarely used.

For now, just disable support for FS_VERITY in these odd configurations
to ensure it isn't used in cases where it would have incorrect behavior.

Fixes: 671e67b47e9f ("fs-verity: add Kconfig and the helper functions for hashing")
Reported-by: Christoph Hellwig <hch@lst.de>
Closes: https://lore.kernel.org/r/20260119063349.GA643@lst.de
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
 fs/verity/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/verity/Kconfig b/fs/verity/Kconfig
index 76d1c5971b82..b20882963ffb 100644
--- a/fs/verity/Kconfig
+++ b/fs/verity/Kconfig
@@ -1,9 +1,12 @@
 # SPDX-License-Identifier: GPL-2.0
 
 config FS_VERITY
 	bool "FS Verity (read-only file-based authenticity protection)"
+	# Filesystems cache the Merkle tree at a 64K aligned offset in the
+	# pagecache.  That approach assumes the page size is at most 64K.
+	depends on PAGE_SHIFT <= 16
 	select CRYPTO_HASH_INFO
 	select CRYPTO_LIB_SHA256
 	select CRYPTO_LIB_SHA512
 	help
 	  This option enables fs-verity.  fs-verity is the dm-verity

base-commit: 8934827db5403eae57d4537114a9ff88b0a8460f
-- 
2.53.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-21 20:45 [f2fs-dev] [PATCH] fsverity: add dependency on 64K or smaller pages Eric Biggers via Linux-f2fs-devel
2026-02-24 13:55 ` David Sterba
2026-02-24 14:19   ` Arnd Bergmann
2026-02-24 14:51 ` Christoph Hellwig
2026-02-24 15:32   ` Theodore Tso
2026-02-24 15:24 ` Theodore Tso
2026-03-03  5:06 ` Eric Biggers via Linux-f2fs-devel

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