From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,wangjinchao600@gmail.com,pmladek@suse.com,joel.granados@kernel.org,rioo.tsukatsukii@gmail.com,akpm@linux-foundation.org
Subject: [merged mm-nonmm-stable] kernel-panic-mark-init_taint_buf-as-__initdata-and-panic-instead-of-warning-in-alloc_taint_buf.patch removed from -mm tree
Date: Fri, 27 Mar 2026 21:24:43 -0700 [thread overview]
Message-ID: <20260328042444.501BDC4CEF7@smtp.kernel.org> (raw)
The quilt patch titled
Subject: kernel/panic: mark init_taint_buf as __initdata and panic instead of warning in alloc_taint_buf()
has been removed from the -mm tree. Its filename was
kernel-panic-mark-init_taint_buf-as-__initdata-and-panic-instead-of-warning-in-alloc_taint_buf.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Rio <rioo.tsukatsukii@gmail.com>
Subject: kernel/panic: mark init_taint_buf as __initdata and panic instead of warning in alloc_taint_buf()
Date: Mon, 23 Feb 2026 09:29:14 +0530
However there's a convention of assuming that __init-time allocations
cannot fail. Because if a kmalloc() were to fail at this time, the kernel
is hopelessly messed up anyway. So simply panic() if that kmalloc failed,
then make that 350-byte buffer __initdata.
Link: https://lkml.kernel.org/r/20260223035914.4033-1-rioo.tsukatsukii@gmail.com
Signed-off-by: Rio <rioo.tsukatsukii@gmail.com>
Cc: Joel Granados <joel.granados@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Wang Jinchao <wangjinchao600@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/panic.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
--- a/kernel/panic.c~kernel-panic-mark-init_taint_buf-as-__initdata-and-panic-instead-of-warning-in-alloc_taint_buf
+++ a/kernel/panic.c
@@ -865,8 +865,8 @@ static void print_tainted_seq(struct seq
*/
#define INIT_TAINT_BUF_MAX 350
-static char init_taint_buf[INIT_TAINT_BUF_MAX];
-static char *taint_buf = init_taint_buf;
+static char init_taint_buf[INIT_TAINT_BUF_MAX] __initdata;
+static char *taint_buf __refdata = init_taint_buf;
static size_t taint_buf_size = INIT_TAINT_BUF_MAX;
static __init int alloc_taint_buf(void)
@@ -887,11 +887,7 @@ static __init int alloc_taint_buf(void)
buf = kmalloc(size, GFP_KERNEL);
if (!buf) {
- /* Allocation may fail; this warning explains possibly
- * truncated taint strings
- */
- pr_warn_once("taint string buffer allocation failed, using fallback buffer\n");
- return 0;
+ panic("Failed to allocate taint string buffer");
}
taint_buf = buf;
_
Patches currently in -mm which might be from rioo.tsukatsukii@gmail.com are
reply other threads:[~2026-03-28 4:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260328042444.501BDC4CEF7@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=joel.granados@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rioo.tsukatsukii@gmail.com \
--cc=wangjinchao600@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.