lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 29 Jul 2022 14:13:12 +0800
From:   Zeng Jingxiang <zengjx95@...il.com>
To:     ast@...nel.org, daniel@...earbox.net, john.fastabend@...il.com,
        andrii@...nel.org, martin.lau@...ux.dev, song@...nel.org,
        yhs@...com, kpsingh@...nel.org, sdf@...gle.com, haoluo@...gle.com,
        jolsa@...nel.org
Cc:     bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
        Zeng Jingxiang <linuszeng@...cent.com>
Subject: [PATCH] bpf/verifier: fix control flow issues in __reg32_bound_s64()

From: Zeng Jingxiang <linuszeng@...cent.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@...cent.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ