diff options
author | Alexei Starovoitov <ast@kernel.org> | 2021-11-01 15:21:52 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-18 14:04:13 +0100 |
commit | 4a50bc00847635e092f8f447439d8263afaa65ed (patch) | |
tree | 85d204ac8bcc65f2d20f684fc8f834b1ed30a2f0 /kernel/bpf/verifier.c | |
parent | 84dde8c8c9335213f091977eb1e935f3f38da71c (diff) | |
download | linux-stable-4a50bc00847635e092f8f447439d8263afaa65ed.tar.gz linux-stable-4a50bc00847635e092f8f447439d8263afaa65ed.tar.bz2 linux-stable-4a50bc00847635e092f8f447439d8263afaa65ed.zip |
bpf: Fix propagation of signed bounds from 64-bit min/max into 32-bit.
[ Upstream commit 388e2c0b978339dee9b0a81a2e546f8979e021e2 ]
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: 3f50f132d840 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r-- | kernel/bpf/verifier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index c56739a4a421..a15826a9a644 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -1298,7 +1298,7 @@ static void __reg_combine_32_into_64(struct bpf_reg_state *reg) static bool __reg64_bound_s32(s64 a) { - return a > S32_MIN && a < S32_MAX; + return a >= S32_MIN && a <= S32_MAX; } static bool __reg64_bound_u32(u64 a) |