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 76d1c5971b82..b20882963ffb 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_SHIFT <= 16
 	select CRYPTO_HASH_INFO
 	select CRYPTO_LIB_SHA256
 	select CRYPTO_LIB_SHA512

base-commit: 725bd2f3c81d54edccb66fead01d4c0c222e2231

Signature · 1 line
2.56.0
maintainer Applied
#1 lore raw

Patch "fsverity: add dependency on 64K or smaller pages" has been added to the 6.18-stable tree

This is a note to let you know that I've just added the patch titled

fsverity: add dependency on 64K or smaller pages

to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
fsverity-add-dependency-on-64k-or-smaller-pages.patch
and it can be found in the queue-6.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Tue Oct 6 23:42:57 2026
From: Eric Biggers <[email protected]>
Date: Tue, 6 Oct 2026 23:41:37 +0200
Subject: fsverity: add dependency on 64K or smaller pages
To: [email protected]
Cc: [email protected], Eric Biggers <[email protected]>, Christoph Hellwig <[email protected]>, Theodore Ts'o <[email protected]>
Message-ID: <[email protected]>

From: Eric Biggers <[email protected]>

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
@@ -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_SHIFT <= 16
 	select CRYPTO_HASH_INFO
 	select CRYPTO_LIB_SHA256
 	select CRYPTO_LIB_SHA512

Patches currently in stable-queue which might be from [email protected] are

queue-6.18/fs-fsverity-reject-size-changes-on-fsverity-files-in-setattr_prepare.patch queue-6.18/fs-fsverity-remove-check-for-fsverity-being-enabled-in-setattr_prepare.patch queue-6.18/fsverity-add-dependency-on-64k-or-smaller-pages.patch queue-6.18/crypto-x86-aes-gcm-fix-always-true-check-for-last-aad-segment.patch