[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230713065937.GA2199@sol.localdomain>
Date: Wed, 12 Jul 2023 23:59:37 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: linux-hardening@...r.kernel.org, Kees Cook <keescook@...omium.org>,
"Guilherme G. Piccoli" <gpiccoli@...lia.com>
Subject: Re: [PATCH v3 1/2] pstore: Remove worst-case compression size logic
On Wed, Jul 12, 2023 at 06:23:31PM +0200, Ard Biesheuvel wrote:
> 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 <keescook@...omium.org>
> Signed-off-by: Kees Cook <keescook@...omium.org>
> Tested-by: Guilherme G. Piccoli <gpiccoli@...lia.com> # Steam Deck
> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> ---
> fs/pstore/platform.c | 206 ++------------------
> 1 file changed, 19 insertions(+), 187 deletions(-)
Reviewed-by: Eric Biggers <ebiggers@...gle.com>
- Eric
Powered by blists - more mailing lists