]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: show real jited prog address in /proc/kallsyms
authorSong Liu <songliubraving@fb.com>
Fri, 2 Nov 2018 17:16:15 +0000 (10:16 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 2 Nov 2018 20:39:01 +0000 (21:39 +0100)
commitdf0734702a7cbba49d6765bd5ba069340bf9c5db
treebf584cf3f67ab7aaae634d4975575d701e9fe1c8
parent7de414a9dd91426318df7b63da024b2b07e53df5
bpf: show real jited prog address in /proc/kallsyms

Currently, /proc/kallsyms shows page address of jited bpf program. The
main reason here is to not expose randomized start address. However,
This is not ideal for detailed profiling (find hot instructions from
stack traces). This patch replaces the page address with real prog start
address.

This change is OK because these addresses are still protected by sysctl
kptr_restrict (see kallsyms_show_value()), and only programs loaded by
root are added to kallsyms (see bpf_prog_kallsyms_add()).

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/core.c