Thread (15 messages) 15 messages, 6 authors, 2021-06-22

Re: [PATCH bpf-next 0/1] arm64: Add BPF exception tables

From: Ravi Bangoria <hidden>
Date: 2021-06-22 07:12:07
Also in: bpf

Hi Alexei,

On 6/18/21 10:04 PM, Alexei Starovoitov wrote:
On Wed, Jun 16, 2021 at 11:58 PM Ravi Bangoria
[off-list ref] wrote:
quoted
    $ dmesg
    [  166.864325] BUG: unable to handle page fault for address: 0000000000d12345
    [  166.864336] #PF: supervisor read access in kernel mode
    [  166.864338] #PF: error_code(0x0000) - not-present page

0xd12345 is unallocated userspace address. Similarly, I also tried with
that's unfortunately expected, since this is a user address.
Sure. fwiw, it works with bpf_probe_read().
quoted
p->dte = (void *)0xffffffffc1234567 after confirming it's not allocated
to kernel or any module address. I see the same failure with it too.
This one is surprising though. Sounds like a bug in exception table
construction. Can you debug it to see what's causing it?
First check that do_kern_addr_fault() is invoked in this case.
And then fixup_exception() and why search_bpf_extables()
cannot find it.
It seems the commit 4c5de127598e1 ("bpf: Emit explicit NULL pointer checks
for PROBE_LDX instructions.") added few instructions before actual load
but does not consider those additional instruction while calculating
extable offset. Let me prepare a fix.
Separately we probably need to replace the NULL check
with addr >= TASK_SIZE_MAX to close this issue though it's a bit artificial.
Ravi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help