]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Enforce 'return 0' in BTF-enabled raw_tp programs
authorAlexei Starovoitov <ast@kernel.org>
Tue, 29 Oct 2019 03:24:26 +0000 (20:24 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 30 Oct 2019 15:22:55 +0000 (16:22 +0100)
commit63eae7216364647284577c368e18bf5c103db1c0
tree6bfe97e74e387d3b4941d653bac5aafc3c2cc83d
parent14acb4036ad421240083494c8f2173fde1e2f3d0
bpf: Enforce 'return 0' in BTF-enabled raw_tp programs

The return value of raw_tp programs is ignored by __bpf_trace_run()
that calls them. The verifier also allows any value to be returned.
For BTF-enabled raw_tp lets enforce 'return 0', so that return value
can be used for something in the future.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20191029032426.1206762-1-ast@kernel.org
kernel/bpf/verifier.c