diff options
author | Eric Biggers <ebiggers@google.com> | 2022-12-23 12:36:28 -0800 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2023-01-09 19:05:47 -0800 |
commit | 284d5db5f99efa9e3549eb3cba39379d48879db1 (patch) | |
tree | 992acc4d74a9accc0bdbb1f73b0b4ac2d311346e /scripts/Makefile.ubsan | |
parent | 86f66569baca98478b7ff2f49c8ee54cf3b108cd (diff) |
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
Diffstat (limited to 'scripts/Makefile.ubsan')
0 files changed, 0 insertions, 0 deletions