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

Eugen Hristev
2025-11-19T15:45:44Z

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

Information on these variables is stored into dedicated inspection section.

Signed-off-by: Eugen Hristev <eugen.hristev@linaro.org>
---
kernel/panic.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/kernel/panic.c b/kernel/panic.c
index 24cc3eec1805..e99539e18054 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>

@@ -56,6 +57,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);
@@ -662,6 +664,8 @@ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = {
TAINT_FLAG(FWCTL, 'J', ' ', true),
};

+MEMINSPECT_SIMPLE_ENTRY(taint_flags);
+
#undef TAINT_FLAG

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