OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9979db
)
bpf: Fix propagation of signed bounds from 64-bit min/max into 32-bit.
author
Alexei Starovoitov
<ast@kernel.org>
Mon, 1 Nov 2021 22:21:52 +0000
(15:21 -0700)
committer
Andrii Nakryiko
<andrii@kernel.org>
Tue, 2 Nov 2021 01:05:12 +0000
(18:05 -0700)
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
kernel/bpf/verifier.c
patch
|
blob
|
history
diff --git
a/kernel/bpf/verifier.c
b/kernel/bpf/verifier.c
index
29671ed
..
a4b48bd
100644
(file)
--- a/
kernel/bpf/verifier.c
+++ b/
kernel/bpf/verifier.c
@@
-1420,7
+1420,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)