• Song Liu's avatar
    bpf: show real jited prog address in /proc/kallsyms · df073470
    Song Liu authored
    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: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    df073470
core.c 46.7 KB