Skip to contentSkip to conversation

fsverity: add dependency on 64K or smaller pages

PATCH Applied Eric Biggers 2 participants 2 messages Oct 6 – Oct 7

Subsystems (2)
lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 fsverity: add dependency on 64K or smaller pages

commit a300000233a9ff842e2fb450fb9a79f7827a586d upstream.

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.

---
 fs/verity/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
fs/verity/Kconfig +3 -0
index aad1f1d998b9..6882f85e0a11 100644
@@ -2,6 +2,9 @@
 
 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_SIZE_256KB
 	select CRYPTO
 	select CRYPTO_HASH_INFO
 	# SHA-256 is implied as it's intended to be the default hash algorithm.

base-commit: a500ba24937a966eab140b95eac42782a7ce2c85

Signature · 1 line
2.56.0
maintainer Applied
#1 lore raw
Quoted 2 lines

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.

Queued for 6.1, thanks.

Signature · 2 lines
Thanks,
Sasha