Message ID | 20210416025537.2352753-2-davemarchevsky@fb.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | bpf: refine retval for bpf_get_task_stack helper | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for bpf-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 5 maintainers not CCed: netdev@vger.kernel.org kpsingh@kernel.org andrii@kernel.org kafai@fb.com john.fastabend@gmail.com |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 20 this patch: 20 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 7 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 20 this patch: 20 |
netdev/header_inline | success | Link |
> On Apr 15, 2021, at 7:55 PM, Dave Marchevsky <davemarchevsky@fb.com> wrote: > > Verifier can constrain the min/max bounds of bpf_get_task_stack's return > value more tightly than the default tnum_unknown. Like bpf_get_stack, > return value is num bytes written into a caller-supplied buf, or error, > so do_refine_retval_range will work. > > Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com> Acked-by: Song Liu <songliubraving@fb.com> > --- > kernel/bpf/verifier.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > index 852541a435ef..348e97f77003 100644 > --- a/kernel/bpf/verifier.c > +++ b/kernel/bpf/verifier.c > @@ -5767,6 +5767,7 @@ static void do_refine_retval_range(struct bpf_reg_state *regs, int ret_type, > > if (ret_type != RET_INTEGER || > (func_id != BPF_FUNC_get_stack && > + func_id != BPF_FUNC_get_task_stack && > func_id != BPF_FUNC_probe_read_str && > func_id != BPF_FUNC_probe_read_kernel_str && > func_id != BPF_FUNC_probe_read_user_str)) > -- > 2.30.2 >
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 852541a435ef..348e97f77003 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -5767,6 +5767,7 @@ static void do_refine_retval_range(struct bpf_reg_state *regs, int ret_type, if (ret_type != RET_INTEGER || (func_id != BPF_FUNC_get_stack && + func_id != BPF_FUNC_get_task_stack && func_id != BPF_FUNC_probe_read_str && func_id != BPF_FUNC_probe_read_kernel_str && func_id != BPF_FUNC_probe_read_user_str))
Verifier can constrain the min/max bounds of bpf_get_task_stack's return value more tightly than the default tnum_unknown. Like bpf_get_stack, return value is num bytes written into a caller-supplied buf, or error, so do_refine_retval_range will work. Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com> --- kernel/bpf/verifier.c | 1 + 1 file changed, 1 insertion(+)