From: Jonathan McDowell <noodles@fb.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>,
"kexec@lists.infradead.org" <kexec@lists.infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Mimi Zohar <zohar@linux.ibm.com>,
Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
Matthew Garrett <mjg59@srcf.ucam.org>,
Dmitrii Potoskuev <dpotoskuev@fb.com>
Subject: [RFC PATCH 6/7] HACK: Allow the use of generic decompress with gzip outside __init
Date: Fri, 8 Jul 2022 10:12:32 +0000 [thread overview]
Message-ID: <942e53a4062d7915b5e90e370742f18f42741fbe.1657272362.git.noodles@fb.com> (raw)
In-Reply-To: <cover.1657272362.git.noodles@fb.com>
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@fb.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
next prev parent reply other threads:[~2022-07-08 10:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 10:10 [RFC PATCH 0/7] ima: Support measurement of kexec initramfs components Jonathan McDowell
2022-07-08 10:11 ` [RFC PATCH 1/7] initramfs: Move cpio handling routines into lib/ Jonathan McDowell
2022-07-08 10:11 ` [RFC PATCH 2/7] lib/cpio: Improve error handling Jonathan McDowell
2022-07-08 10:12 ` [RFC PATCH 3/7] lib/cpio: use non __init filesystem related functions Jonathan McDowell
2022-07-11 8:38 ` [lib/cpio] 0e4846b4e7: Initramfs_unpacking_failed kernel test robot
2022-07-08 10:12 ` [RFC PATCH 4/7] lib/cpio: Allow use outside of initramfs creation Jonathan McDowell
2022-07-08 10:12 ` [RFC PATCH 5/7] lib/cpio: Add a parse-only option that doesn't extract any files Jonathan McDowell
2022-07-08 10:12 ` Jonathan McDowell [this message]
2022-07-08 10:12 ` [RFC PATCH 7/7] ima: Support measurement of kexec initramfs components Jonathan McDowell
2022-07-08 11:49 ` [RFC PATCH 0/7] " Mimi Zohar
2022-07-08 15:34 ` Jonathan McDowell
2022-07-28 14:08 ` [RFC PATCH v2 " Jonathan McDowell
2022-07-28 14:09 ` [RFC PATCH v2 1/7] initramfs: Move cpio handling routines into lib/ Jonathan McDowell
2022-07-28 14:09 ` [RFC PATCH v2 2/7] lib/cpio: Improve error handling Jonathan McDowell
2022-07-28 14:09 ` [RFC PATCH v2 3/7] lib/cpio: use non __init filesystem related functions Jonathan McDowell
2022-07-28 14:09 ` [RFC PATCH v2 4/7] lib/cpio: Allow use outside of initramfs creation Jonathan McDowell
2022-07-28 14:09 ` [RFC PATCH v2 5/7] lib/cpio: Add a parse-only option that doesn't extract any files Jonathan McDowell
2022-07-28 14:09 ` [RFC PATCH v2 6/7] HACK: Allow the use of generic decompress with gzip outside __init Jonathan McDowell
2022-07-28 14:09 ` [RFC PATCH v2 7/7] ima: Support measurement of kexec initramfs components Jonathan McDowell
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=942e53a4062d7915b5e90e370742f18f42741fbe.1657272362.git.noodles@fb.com \
--to=noodles@fb.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=dpotoskuev@fb.com \
--cc=jmorris@namei.org \
--cc=kexec@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=serge@hallyn.com \
--cc=viro@zeniv.linux.org.uk \
--cc=zohar@linux.ibm.com \
/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
all inboxes | Powered by JetHome®