mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
UPSTREAM: bpf: Fix check_return_code to only allow [0,1] in trace_iter progs
As per 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program") we only
allow a range of [0,1] for return codes. Therefore BPF_TRACE_ITER relies
on the default tnum_range(0, 1) which is set in range var. On recent merge
of net into net-next commit e92888c72fbd ("bpf: Enforce returning 0 for
fentry/fexit progs") got pulled in and caused a merge conflict with the
changes from 15d83c4d7cef. The resolution had a snall hiccup in that it
removed the [0,1] range restriction again so that BPF_TRACE_ITER would
have no enforcement. Fix it by adding it back.
Fixes: da07f52d3caf ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
Change-Id: Ia6d3901bbe0879e698c751ff7e18487e46115914
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
12cd705450
commit
3c7bb5ccb2
1 changed files with 2 additions and 0 deletions
|
|
@ -7320,6 +7320,8 @@ static int check_return_code(struct bpf_verifier_env *env)
|
|||
case BPF_TRACE_RAW_TP:
|
||||
case BPF_MODIFY_RETURN:
|
||||
return 0;
|
||||
case BPF_TRACE_ITER:
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue