]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix extable fixup offset.
authorAlexei Starovoitov <ast@kernel.org>
Thu, 16 Dec 2021 02:38:30 +0000 (18:38 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 16 Dec 2021 20:18:26 +0000 (21:18 +0100)
commit4e1ba42b46dfa6b011239f08e7996770e8c5e72d
tree7c8ba3972352c398cd4c96c1890c712f1c4a4fd2
parentb5bc32df9dac40c33d013cb2350b12d9ee430607
bpf: Fix extable fixup offset.

The prog - start_of_ldx is the offset before the faulting ldx to the location
after it, so this will be used to adjust pt_regs->ip for jumping over it and
continuing, and with old temp it would have been fixed up to the wrong offset,
causing crash.

Fixes: 136162d4b079 ("bpf: Emit explicit NULL pointer checks for PROBE_LDX instructions.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
arch/x86/net/bpf_jit_comp.c