Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernel/panic: increase buffer size for verbose taint logging

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.

[akpm@linux-foundation.org: fix spello, add comment]
Link: https://lkml.kernel.org/r/20260220151500.13585-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>

authored by

Rio and committed by
Andrew Morton
a75d2079 3f80aa1a

+6 -2
+6 -2
kernel/panic.c
··· 801 801 * Documentation/admin-guide/tainted-kernels.rst, including its 802 802 * small shell script that prints the TAINT_FLAGS_COUNT bits of 803 803 * /proc/sys/kernel/tainted. 804 + * 805 + * Also, update TAINT_BUF_MAX below. 804 806 */ 805 807 const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = { 806 808 TAINT_FLAG(PROPRIETARY_MODULE, 'P', 'G'), ··· 856 854 } 857 855 } 858 856 857 + /* 350 can accommodate all taint flags in verbose mode, with some headroom */ 858 + #define TAINT_BUF_MAX 350 859 + 859 860 static const char *_print_tainted(bool verbose) 860 861 { 861 - /* FIXME: what should the size be? */ 862 - static char buf[sizeof(taint_flags)]; 862 + static char buf[TAINT_BUF_MAX]; 863 863 struct seq_buf s; 864 864 865 865 BUILD_BUG_ON(ARRAY_SIZE(taint_flags) != TAINT_FLAGS_COUNT);