]> www.infradead.org Git - users/jedix/linux-maple.git/commit
alloc_tag: fix allocation tag reporting when CONFIG_MODULES=n
authorSuren Baghdasaryan <surenb@google.com>
Wed, 28 Aug 2024 23:15:36 +0000 (16:15 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 00:59:03 +0000 (17:59 -0700)
commit052a45c1cb1b32f05dd63a295d65496d8b403283
treebfdf7bd293a27dc0fa831c8e254529686c8e89ac
parent409faf8c97d5abb0597ea43e99c8b3dd8dbe99e3
alloc_tag: fix allocation tag reporting when CONFIG_MODULES=n

codetag_module_init() is used to initialize sections containing allocation
tags.  This function is used to initialize module sections as well as core
kernel sections, in which case the module parameter is set to NULL.  This
function has to be called even when CONFIG_MODULES=n to initialize core
kernel allocation tag sections.  When CONFIG_MODULES=n, this function is a
NOP, which is wrong.  This leads to /proc/allocinfo reported as empty.
Fix this by making it independent of CONFIG_MODULES.

Link: https://lkml.kernel.org/r/20240828231536.1770519-1-surenb@google.com
Fixes: 916cc5167cc6 ("lib: code tagging framework")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Sourav Panda <souravpanda@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org> [6.10+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/codetag.c