For debugging/setting kernel breakpoints etc, it's useful to know the location of our JIT'd program in memory. Since the start of the JIT'd bpf code is randomised to make ROP more difficult, print out the actual start.
Signed-off-by: Zachary Leaf zachary.leaf@arm.com --- kernel/bpf/core.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 93b7dd22236c..510fec53df3f 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1058,6 +1058,8 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
/* Leave a random number of instructions before BPF code. */ *image_ptr = &hdr->image[start]; + /* The actual start of the JIT code */ + printk("%s JIT loc=%#lx\n", __func__, *image_ptr);
return hdr; }