linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] pstore: Replace crypto API compression with zlib calls
@ 2023-07-12 16:23 Ard Biesheuvel
  2023-07-12 16:23 ` [PATCH v3 1/2] pstore: Remove worst-case compression size logic Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2023-07-12 16:23 UTC (permalink / raw)
  To: linux-hardening
  Cc: Ard Biesheuvel, Kees Cook, Guilherme G. Piccoli, Eric Biggers

The pstore layer implements support for compression of kernel log
output, using a variety of compression algorithms provided by the
[deprecated] crypto API 'comp' interface.

This appears to have been somebody's pet project rather than a solution
to a real problem: the original deflate compression is reasonably fast,
compresses well and is comparatively small in terms of code footprint,
and so the flexibility that the crypto API integration provides does
little more than complicate the code for no reason.

So let's get rid of this complexity, and switch back to zlib deflate
using the library interface.

Changes since v2:
- some more prose improvements and NULL checks/assignments suggested by
  Eric
- reset author on patch #1
- add Guilherme's Tested-by

Changes since v1:
- add missing vfree() of zlib compression workspace
- implement improvements and simplifications suggested by Eric
- add missing zlib_in/deflateEnd() calls
- add code comment to document that the use of a library interface is
  deliberate, and doesn't require a future 'upgrade' to the crypto API

Cc: Kees Cook <keescook@chromium.org>
Cc: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: Eric Biggers <ebiggers@kernel.org>

Ard Biesheuvel (2):
  pstore: Remove worst-case compression size logic
  pstore: Replace crypto API compression with zlib_deflate library calls

 fs/pstore/Kconfig    | 100 +-----
 fs/pstore/platform.c | 330 ++++++--------------
 2 files changed, 110 insertions(+), 320 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-13 17:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2023-07-13 17:37 ` [PATCH v3 0/2] pstore: Replace crypto API compression with zlib calls Kees Cook

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).