[PATCH v2 14/25] panic: Annotate static information into meminspect

From: Mukesh Ojha

Date: Tue Mar 10 2026 - 16:20:00 EST


From: Eugen Hristev <eugen.hristev@xxxxxxxxxx>

Annotate vital static information into inspection table:
- tainted_mask
- taint_flags

Information on these variables is stored into dedicated meminspect
section.

Signed-off-by: Eugen Hristev <eugen.hristev@xxxxxxxxxx>
Signed-off-by: Mukesh Ojha <mukesh.ojha@xxxxxxxxxxxxxxxx>
---
kernel/panic.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/kernel/panic.c b/kernel/panic.c
index 20feada5319d..ea1969d81fd9 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -37,6 +37,7 @@
#include <linux/context_tracking.h>
#include <linux/seq_buf.h>
#include <linux/sys_info.h>
+#include <linux/meminspect.h>
#include <trace/events/error_report.h>
#include <asm/sections.h>

@@ -57,6 +58,7 @@ static unsigned int __read_mostly sysctl_oops_all_cpu_backtrace;
int panic_on_oops = IS_ENABLED(CONFIG_PANIC_ON_OOPS);
static unsigned long tainted_mask =
IS_ENABLED(CONFIG_RANDSTRUCT) ? (1 << TAINT_RANDSTRUCT) : 0;
+MEMINSPECT_SIMPLE_ENTRY(tainted_mask);
static int pause_on_oops;
static int pause_on_oops_flag;
static DEFINE_SPINLOCK(pause_on_oops_lock);
@@ -827,6 +829,8 @@ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = {
TAINT_FLAG(FWCTL, 'J', ' '),
};

+MEMINSPECT_SIMPLE_ENTRY(taint_flags);
+
#undef TAINT_FLAG

static void print_tainted_seq(struct seq_buf *s, bool verbose)

--
2.50.1