All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bpf/verifier: fix control flow issues in __reg32_bound_s64()
@ 2022-07-29  6:13 Zeng Jingxiang
  0 siblings, 0 replies; only message in thread
From: Zeng Jingxiang @ 2022-07-29  6:13 UTC (permalink / raw)
  To: ast, daniel, john.fastabend, andrii, martin.lau, song, yhs,
	kpsingh, sdf, haoluo, jolsa
  Cc: bpf, linux-kernel, Zeng Jingxiang

From: Zeng Jingxiang <linuszeng@tencent.com>

expression "a <= S32_MAX" is always true
1580	static bool __reg32_bound_s64(s32 a)
1581	{
1582		return a >= 0;
1583	}

Fixes: e572ff80f05c ("bpf: Make 32->64 bounds propagation slightly more robust")
Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com>
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 0efbac0fd126..bd154bcf1599 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1579,7 +1579,7 @@ static void reg_bounds_sync(struct bpf_reg_state *reg)
 
 static bool __reg32_bound_s64(s32 a)
 {
-	return a >= 0 && a <= S32_MAX;
+	return a >= 0;
 }
 
 static void __reg_assign_32_into_64(struct bpf_reg_state *reg)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-29  6:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-29  6:13 [PATCH] bpf/verifier: fix control flow issues in __reg32_bound_s64() Zeng Jingxiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.