linux/fs/verity
Eric Biggers 284d5db5f9 fsverity: use unsigned long for level_start
fs/verity/ isn't consistent with whether Merkle tree block indices are
'unsigned long' or 'u64'.  There's no real point to using u64 for them,
though, since (a) a Merkle tree with over ULONG_MAX blocks would only be
needed for a file larger than MAX_LFS_FILESIZE, and (b) for reads, the
status of all Merkle tree blocks has to be tracked in memory.

Therefore, let's make things a bit more efficient on 32-bit systems by
using 'unsigned long[]' for merkle_tree_params::level_start, instead of
'u64[]'.  Also, to be extra safe, explicitly check that there aren't
more than ULONG_MAX Merkle tree blocks.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Tested-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20221223203638.41293-2-ebiggers@kernel.org
2023-01-09 19:05:47 -08:00
..
enable.c fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG 2023-01-01 15:46:48 -08:00
fsverity_private.h fsverity: use unsigned long for level_start 2023-01-09 19:05:47 -08:00
hash_algs.c fsverity: simplify fsverity_get_digest() 2022-11-29 21:07:41 -08:00
init.c fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG 2023-01-01 15:46:48 -08:00
Kconfig fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG 2023-01-01 15:46:48 -08:00
Makefile fs-verity: add FS_IOC_READ_VERITY_METADATA ioctl 2021-02-07 14:51:11 -08:00
measure.c fsverity: simplify fsverity_get_digest() 2022-11-29 21:07:41 -08:00
open.c fsverity: use unsigned long for level_start 2023-01-09 19:05:47 -08:00
read_metadata.c fs-verity: use kmap_local_page() instead of kmap() 2022-08-19 15:19:55 -07:00
signature.c fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG 2023-01-01 15:46:48 -08:00
verify.c fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG 2023-01-01 15:46:48 -08:00