]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Ensure line_info.insn_off cannot point to insn with zero code
authorMartin KaFai Lau <kafai@fb.com>
Wed, 19 Dec 2018 21:01:01 +0000 (13:01 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Dec 2018 23:42:55 +0000 (15:42 -0800)
commit6eaf331a6b99c9cef1078e274300cc311bcf7bb9
treeb99ead4b2f848949b21d9b5a0cb552b4ac6a9972
parent25c4829b8e3c8c732fb62684ec1ebccc5fdde1c2
bpf: Ensure line_info.insn_off cannot point to insn with zero code

This patch rejects a line_info if the bpf insn code referred by
line_info.insn_off is 0. F.e. a broken userspace tool might generate
a line_info.insn_off that points to the second 8 bytes of a BPF_LD_IMM64.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c