pgo: Limit allocate_node() to vmlinux sections
authorJarmo Tiitto <jarmo.tiitto@gmail.com>
Fri, 4 Jun 2021 16:58:20 +0000 (19:58 +0300)
committerKees Cook <keescook@chromium.org>
Tue, 29 Jun 2021 20:25:40 +0000 (13:25 -0700)
commit75eee5108425440c72b1d58862da4c1675323f63
treef57a95cf498e24e428f9d057507f81ca68fffab4
parent2035a55750f309be25fefc4e976be14bba4ce32b
pgo: Limit allocate_node() to vmlinux sections

When Clang instrumentation eventually calls allocate_node() the struct
llvm_prf_data *p argument tells us from what section we should reserve
the vnode: It either points into vmlinux's core __llvm_prf_data section
or some loaded module's __llvm_prf_data section.

But since we don't have access to corresponding __llvm_prf_vnds section(s)
for any module, the function should return just NULL and ignore any
profiling attempts from modules for now.

Signed-off-by: Jarmo Tiitto <jarmo.tiitto@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210604165819.7947-1-jarmo.tiitto@gmail.com
kernel/pgo/instrument.c