lkml.org 
[lkml]   [2023]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] bpf: skip invalid kfunc call in backtrack_insn
From


On 1/3/23 5:47 PM, Hao Sun wrote:
> The verifier skips invalid kfunc call in check_kfunc_call(), which
> would be captured in fixup_kfunc_call() if such insn is not
> eliminated by dead code elimination. However, this can lead to the
> following warning in backtrack_insn(), alse see [1]:
>
> ------------[ cut here ]------------
> verifier backtracking bug
> WARNING: CPU: 6 PID: 8646 at kernel/bpf/verifier.c:2756 backtrack_insn
> kernel/bpf/verifier.c:2756
> __mark_chain_precision kernel/bpf/verifier.c:3065
> mark_chain_precision kernel/bpf/verifier.c:3165
> adjust_reg_min_max_vals kernel/bpf/verifier.c:10715
> check_alu_op kernel/bpf/verifier.c:10928
> do_check kernel/bpf/verifier.c:13821 [inline]
> do_check_common kernel/bpf/verifier.c:16289
> ...
>
> So make backtracking conservative with this by returning ENOTSUPP.
>
> [1] https://lore.kernel.org/bpf/CACkBjsaXNceR8ZjkLG=dT3P=4A8SBsg0Z5h5PWLryF5=ghKq=g@mail.gmail.com/
>
> Signed-off-by: Hao Sun <sunhao.th@gmail.com>

Acked-by: Yonghong Song <yhs@fb.com>

\
 
 \ /
  Last update: 2023-03-26 23:27    [W:0.047 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site