linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] fsverity: support for non-4K pages
@ 2022-10-28 22:45 Eric Biggers
  2022-10-28 22:45 ` [PATCH 1/6] fsverity: support verification with tree block size < PAGE_SIZE Eric Biggers
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Eric Biggers @ 2022-10-28 22:45 UTC (permalink / raw)
  To: linux-fscrypt; +Cc: linux-fsdevel, linux-ext4, linux-f2fs-devel, linux-btrfs

[This patchset applies to v6.1-rc2 + my other patch
 https://lore.kernel.org/r/20221028175807.55495-1-ebiggers@kernel.org.
 You can get everything from tag "fsverity-non4k-v1" of
 https://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git]

Currently, filesystems (ext4, f2fs, and btrfs) only support fsverity
when the Merkle tree block size, filesystem block size, and page size
are all the same.  In practice that means 4K, since increasing the page
size, e.g. to 16K, forces the Merkle tree block size and filesystem
block size to be increased accordingly.  That can be impractical; for
one, users want the same file signatures to work on all systems.

Therefore, this patchset reduces the coupling between these sizes.

First, patches 1-4 allow the Merkle tree block size to be less than the
page size or filesystem block size, provided that it's not larger than
either one.  This involves, among other things, changing the way that
fs/verity/verify.c tracks which hash blocks have been verified.

Second, patches 5-6 makes ext4 support fsverity when the filesystem
block size is less than the page size.  Note, f2fs doesn't need similar
changes because f2fs always assumes that the filesystem block size and
page size are the same anyway.  I haven't looked into btrfs yet.

I've tested this patchset with changes to the verity tests in xfstests.
I'll be sending out these xfstests changes separately.

Eric Biggers (6):
  fsverity: support verification with tree block size < PAGE_SIZE
  fsverity: support enabling with tree block size < PAGE_SIZE
  ext4: simplify ext4_readpage_limit()
  f2fs: simplify f2fs_readpage_limit()
  fs/buffer.c: support fsverity in block_read_full_folio()
  ext4: allow verity with fs block size < PAGE_SIZE

 Documentation/filesystems/fsverity.rst |  76 +++---
 fs/buffer.c                            |  66 ++++-
 fs/ext4/readpage.c                     |   3 +-
 fs/ext4/super.c                        |   5 -
 fs/f2fs/data.c                         |   3 +-
 fs/verity/enable.c                     | 268 ++++++++++----------
 fs/verity/fsverity_private.h           |  17 +-
 fs/verity/hash_algs.c                  |  48 ++--
 fs/verity/open.c                       | 101 ++++++--
 fs/verity/verify.c                     | 325 +++++++++++++++++--------
 include/linux/fsverity.h               |  14 +-
 11 files changed, 575 insertions(+), 351 deletions(-)

-- 
2.38.0


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

end of thread, other threads:[~2022-10-28 22:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 22:45 [PATCH 0/6] fsverity: support for non-4K pages Eric Biggers
2022-10-28 22:45 ` [PATCH 1/6] fsverity: support verification with tree block size < PAGE_SIZE Eric Biggers
2022-10-28 22:45 ` [PATCH 2/6] fsverity: support enabling " Eric Biggers
2022-10-28 22:45 ` [PATCH 3/6] ext4: simplify ext4_readpage_limit() Eric Biggers
2022-10-28 22:45 ` [PATCH 4/6] f2fs: simplify f2fs_readpage_limit() Eric Biggers
2022-10-28 22:45 ` [PATCH 5/6] fs/buffer.c: support fsverity in block_read_full_folio() Eric Biggers
2022-10-28 22:45 ` [PATCH 6/6] ext4: allow verity with fs block size < PAGE_SIZE Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).