Skip to content

Commit 388e2c0

Browse files
Alexei Starovoitovanakryiko
authored andcommitted
bpf: Fix propagation of signed bounds from 64-bit min/max into 32-bit.
Similar to unsigned bounds propagation fix signed bounds. The 'Fixes' tag is a hint. There is no security bug here. The verifier was too conservative. Fixes: 3f50f13 ("bpf: Verifier, do explicit ALU32 bounds tracking") Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20211101222153.78759-2-alexei.starovoitov@gmail.com
1 parent b9979db commit 388e2c0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ static void __reg_combine_32_into_64(struct bpf_reg_state *reg)
14201420

14211421
static bool __reg64_bound_s32(s64 a)
14221422
{
1423-
return a > S32_MIN && a < S32_MAX;
1423+
return a >= S32_MIN && a <= S32_MAX;
14241424
}
14251425

14261426
static bool __reg64_bound_u32(u64 a)

0 commit comments

Comments
 (0)