diff options
| author | Rio <rioo.tsukatsukii@gmail.com> | 2026-02-20 20:45:00 +0530 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-03-27 21:19:33 -0700 |
| commit | a75d207916de0909e2244bc66a44d72fadbcf383 (patch) | |
| tree | 5bde51ae6ecd4e639c6dd3cbe418f864190dcfcf /kernel/panic.c | |
| parent | 3f80aa1a2a44298c59e8e2ab9b10d9971cfd8c48 (diff) | |
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>
Diffstat (limited to 'kernel/panic.c')
| -rw-r--r-- | kernel/panic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index c78600212b6c..75368738d32d 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -801,6 +801,8 @@ EXPORT_SYMBOL(panic); * Documentation/admin-guide/tainted-kernels.rst, including its * small shell script that prints the TAINT_FLAGS_COUNT bits of * /proc/sys/kernel/tainted. + * + * Also, update TAINT_BUF_MAX below. */ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = { TAINT_FLAG(PROPRIETARY_MODULE, 'P', 'G'), @@ -854,10 +856,12 @@ static void print_tainted_seq(struct seq_buf *s, bool verbose) } } +/* 350 can accommodate 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); |
