diff options
author | Ard Biesheuvel <[email protected]> | 2023-07-12 18:23:31 +0200 |
---|---|---|
committer | Kees Cook <[email protected]> | 2023-07-17 16:08:58 -0700 |
commit | 1756ddea6916669125933a8625120c84b57f6559 (patch) | |
tree | 506c7dd337aea802b33033ea2a0594f475d80f77 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | fdf0eaf11452d72945af31804e2a1048ee1b574c (diff) |
pstore: Remove worst-case compression size logic
The worst case compression size used by pstore gives an upper bound for
how much the data might inadvertently *grow* due to encapsulation
overhead if the input is not compressible at all.
Given that pstore records have individual 'compressed' flags, we can
simply store the uncompressed data if compressing it would end up using
more space, making the worst case identical to the uncompressed case.
This means we can just drop all the elaborate logic that reasons about
upper bounds for each individual compression algorithm, and just store
the uncompressed data directly if compression fails for any reason.
Co-developed-by: Kees Cook <[email protected]>
Tested-by: "Guilherme G. Piccoli" <[email protected]> # Steam Deck
Signed-off-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Eric Biggers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions