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 <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent b9979db commit 388e2c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)