[PATCH 02/26] init/version: Annotate static information into meminspect

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

Annotate vital static information into inspection table:
- init_uts_ns
- linux_banner

Information on these variables is stored into dedicated meminspect section.

Signed-off-by: Eugen Hristev <eugen.hristev@linaro.org>
---
init/version-timestamp.c | 3 +++
init/version.c | 3 +++
2 files changed, 6 insertions(+)

diff --git a/init/version-timestamp.c b/init/version-timestamp.c
index d071835121c2..6f920d0e1169 100644
--- a/init/version-timestamp.c
+++ b/init/version-timestamp.c
@@ -6,6 +6,7 @@
#include <linux/refcount.h>
#include <linux/uts.h>
#include <linux/utsname.h>
+#include <linux/meminspect.h>

struct uts_namespace init_uts_ns = {
.ns.ns_type = ns_common_type(&init_uts_ns),
@@ -29,3 +30,5 @@ struct uts_namespace init_uts_ns = {
const char linux_banner[] =
"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
+
+MEMINSPECT_SIMPLE_ENTRY(linux_banner);
diff --git a/init/version.c b/init/version.c
index 94c96f6fbfe6..eeb139236562 100644
--- a/init/version.c
+++ b/init/version.c
@@ -16,6 +16,7 @@
#include <linux/uts.h>
#include <linux/utsname.h>
#include <linux/proc_ns.h>
+#include <linux/meminspect.h>

static int __init early_hostname(char *arg)
{
@@ -51,4 +52,6 @@ const char linux_banner[] __weak;

#include "version-timestamp.c"

+MEMINSPECT_SIMPLE_ENTRY(init_uts_ns);
+
EXPORT_SYMBOL_GPL(init_uts_ns);
--
2.43.0