]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Emit explicit NULL pointer checks for PROBE_LDX instructions.
authorAlexei Starovoitov <ast@kernel.org>
Tue, 2 Feb 2021 05:38:37 +0000 (21:38 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 4 Feb 2021 15:46:44 +0000 (16:46 +0100)
commit136162d4b07987932536ae66b7441fc790bcff6b
tree0a1cdb904666323a00bb0c46c1825df2b2983750
parent6b75e2a99762f7f8d29358031f4f5fdc145293cf
bpf: Emit explicit NULL pointer checks for PROBE_LDX instructions.

PTR_TO_BTF_ID registers contain either kernel pointer or NULL.
Emit the NULL check explicitly by JIT instead of going into
do_user_addr_fault() on NULL deference.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20210202053837.95909-1-alexei.starovoitov@gmail.com
arch/x86/net/bpf_jit_comp.c