* [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
@ 2026-03-28 4:24 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-03-28 4:24 UTC (permalink / raw)
To: mm-commits, wangjinchao600, pmladek, joel.granados,
rioo.tsukatsukii, akpm
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-28 4:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 4:24 [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 Andrew Morton
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.