mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel/panic: increase buffer size for verbose taint logging
@ 2026-02-20 15:15 Rio
  2026-02-20 21:06 ` Andrew Morton
  2026-02-22 14:08 ` [PATCHv2] kernel/panic: allocate taint string buffer dynamically Rio
  0 siblings, 2 replies; 8+ messages in thread
From: Rio @ 2026-02-20 15:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Feng Tang, Petr Mladek, Jinchao Wang, Joel Granados, Pnina Feder,
	linux-kernel, Rio

The verbose 'Tainted: ...' string in print_tainted_seq
can total to 327 characters while the buffer defined in
_print_tainted is 320 bytes. Increase its size to 350
characters to hold all flags, along with some headroom.

Signed-off-by: Rio <rioo.tsukatsukii@gmail.com>
---
 kernel/panic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index c78600212b6c..42b03fdd6ffa 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -854,10 +854,12 @@ static void print_tainted_seq(struct seq_buf *s, bool verbose)
 	}
 }
 
+/* 350 can accomadate all taint flags in verbose mode, with some headroom */
+#define TAINT_BUF_MAX 350
+
 static const char *_print_tainted(bool verbose)
 {
-	/* FIXME: what should the size be? */
-	static char buf[sizeof(taint_flags)];
+	static char buf[TAINT_BUF_MAX];
 	struct seq_buf s;
 
 	BUILD_BUG_ON(ARRAY_SIZE(taint_flags) != TAINT_FLAGS_COUNT);
-- 
2.52.0


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

end of thread, other threads:[~2026-02-23  4:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-20 15:15 [PATCH] kernel/panic: increase buffer size for verbose taint logging Rio
2026-02-20 21:06 ` Andrew Morton
2026-02-21  6:56   ` Rio
2026-02-21 20:03     ` Andrew Morton
2026-02-22 14:08 ` [PATCHv2] kernel/panic: allocate taint string buffer dynamically Rio
2026-02-22 15:23   ` Rio
2026-02-22 19:25   ` Andrew Morton
2026-02-23  3:59   ` [PATCHv3] kernel/panic: mark init_taint_buf as __initdata and panic instead of warning in alloc_taint_buf() Rio

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®