[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <942e53a4062d7915b5e90e370742f18f42741fbe.1657272362.git.noodles@fb.com>
Date: Fri, 8 Jul 2022 10:12:32 +0000
From: Jonathan McDowell <noodles@...com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"kexec@...ts.infradead.org" <kexec@...ts.infradead.org>
CC: Alexander Viro <viro@...iv.linux.org.uk>,
Mimi Zohar <zohar@...ux.ibm.com>,
Dmitry Kasatkin <dmitry.kasatkin@...il.com>,
James Morris <jmorris@...ei.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
Matthew Garrett <mjg59@...f.ucam.org>,
Dmitrii Potoskuev <dpotoskuev@...com>
Subject: [RFC PATCH 6/7] HACK: Allow the use of generic decompress with gzip
outside __init
The generic decompression support is only available in the __init
section. Hack this out for now with gzip for testing. Longer term this
needs rethought in a similar fashion to the cpio support.
Signed-off-by: Jonathan McDowell <noodles@...com>
---
lib/decompress.c | 4 ++--
lib/decompress_inflate.c | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/decompress.c b/lib/decompress.c
index ab3fc90ffc64..89a5709e454a 100644
--- a/lib/decompress.c
+++ b/lib/decompress.c
@@ -48,7 +48,7 @@ struct compress_format {
decompress_fn decompressor;
};
-static const struct compress_format compressed_formats[] __initconst = {
+static const struct compress_format compressed_formats[] = {
{ {0x1f, 0x8b}, "gzip", gunzip },
{ {0x1f, 0x9e}, "gzip", gunzip },
{ {0x42, 0x5a}, "bzip2", bunzip2 },
@@ -60,7 +60,7 @@ static const struct compress_format compressed_formats[] __initconst = {
{ {0, 0}, NULL, NULL }
};
-decompress_fn __init decompress_method(const unsigned char *inbuf, long len,
+decompress_fn decompress_method(const unsigned char *inbuf, long len,
const char **name)
{
const struct compress_format *cf;
diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index 6130c42b8e59..b245d6e5f8a6 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -33,6 +33,10 @@
#define GZIP_IOBUF_SIZE (16*1024)
+/* HACK */
+#undef INIT
+#define INIT
+
static long INIT nofill(void *buffer, unsigned long len)
{
return -1;
--
2.36.1
Powered by blists - more mailing lists