Skip to content

Commit fa123ac

Browse files
jrfastabAlexei Starovoitov
authored and
Alexei Starovoitov
committed
bpf: Verifier, refine 32bit bound in do_refine_retval_range
Further refine return values range in do_refine_retval_range by noting these are int return types (We will assume here that int is a 32-bit type). Two reasons to pull this out of original patch. First it makes the original fix impossible to backport. And second I've not seen this as being problematic in practice unlike the other case. Fixes: 849fa50 ("bpf/verifier: refine retval R0 state for bpf_get_stack helper") Signed-off-by: John Fastabend <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/158560421952.10843.12496354931526965046.stgit@john-Precision-5820-Tower
1 parent 3f50f13 commit fa123ac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4335,6 +4335,7 @@ static void do_refine_retval_range(struct bpf_reg_state *regs, int ret_type,
43354335
return;
43364336

43374337
ret_reg->smax_value = meta->msize_max_value;
4338+
ret_reg->s32_max_value = meta->msize_max_value;
43384339
__reg_deduce_bounds(ret_reg);
43394340
__reg_bound_offset(ret_reg);
43404341
__update_reg_bounds(ret_reg);

0 commit comments

Comments
 (0)