linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-hardening@vger.kernel.org,
	Kees Cook <keescook@chromium.org>,
	"Guilherme G. Piccoli" <gpiccoli@igalia.com>
Subject: Re: [PATCH v3 2/2] pstore: Replace crypto API compression with zlib_deflate library calls
Date: Thu, 13 Jul 2023 00:00:17 -0700	[thread overview]
Message-ID: <20230713070017.GB2199@sol.localdomain> (raw)
In-Reply-To: <20230712162332.2670437-3-ardb@kernel.org>

On Wed, Jul 12, 2023 at 06:23:32PM +0200, Ard Biesheuvel wrote:
> Pstore supports compression using a variety of algorithms exposed by the
> crypto API. This uses the deprecated comp (as opposed to scomp/acomp)
> API, and so we should stop using that, and either move to the new API,
> or switch to a different approach entirely.
> 
> Given that we only compress ASCII text in pstore, and considering that
> this happens when the system is likely to be in an unstable state, the
> flexibility that the complex crypto API provides does not outweigh its
> impact on the risk that we might encounter additional problems when
> trying to commit the kernel log contents to the pstore backend.
> 
> So let's switch [back] to the zlib deflate library API, and remove all
> the complexity that really has no place in a low-level diagnostic
> facility. Note that, while more modern compression algorithms have been
> added to the kernel in recent years, the code size of zlib deflate is
> substantially smaller than, e.g., zstd, while its performance in terms
> of compression ratio is comparable for ASCII text, and speed is deemed
> irrelevant in this context.
> 
> Note that this means that compressed pstore records may no longer be
> accessible after a kernel upgrade, but this has never been part of the
> contract. (The choice of compression algorithm is not stored in the
> pstore records either)
> 
> Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> # Steam Deck
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
>  fs/pstore/Kconfig    | 100 ++------------
>  fs/pstore/platform.c | 136 +++++++++++++-------
>  2 files changed, 97 insertions(+), 139 deletions(-)

Reviewed-by: Eric Biggers <ebiggers@google.com>

- Eric

  reply	other threads:[~2023-07-13  7:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 16:23 [PATCH v3 0/2] pstore: Replace crypto API compression with zlib calls Ard Biesheuvel
2023-07-12 16:23 ` [PATCH v3 1/2] pstore: Remove worst-case compression size logic Ard Biesheuvel
2023-07-13  6:59   ` Eric Biggers
2023-07-12 16:23 ` [PATCH v3 2/2] pstore: Replace crypto API compression with zlib_deflate library calls Ard Biesheuvel
2023-07-13  7:00   ` Eric Biggers [this message]
2023-07-13 17:37 ` [PATCH v3 0/2] pstore: Replace crypto API compression with zlib calls Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230713070017.GB2199@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=ardb@kernel.org \
    --cc=gpiccoli@igalia.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).