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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230705123432.1655-1-machel@vivo.com>
Date:   Wed,  5 Jul 2023 20:33:57 +0800
From:   Wang Ming <machel@...o.com>
To:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Stanislav Fomichev <sdf@...gle.com>,
        Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
        Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>,
        Wang Ming <machel@...o.com>, bpf@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     opensource.kernel@...o.com
Subject: [PATCH v1] selftests:bpf:Fix repeated initialization

In use_missing_map function, value is
initialized twice.There is no
connection between the two assignment.
This patch could fix this bug.

Signed-off-by: Wang Ming <machel@...o.com>
---
 tools/testing/selftests/bpf/progs/test_log_fixup.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/bpf/progs/test_log_fixup.c b/tools/testing/selftests/bpf/progs/test_log_fixup.c
index 1bd48feaaa42..1c49b2f9be6c 100644
--- a/tools/testing/selftests/bpf/progs/test_log_fixup.c
+++ b/tools/testing/selftests/bpf/progs/test_log_fixup.c
@@ -52,13 +52,9 @@ struct {
 SEC("?raw_tp/sys_enter")
 int use_missing_map(const void *ctx)
 {
-	int zero = 0, *value;
+	int zero = 0;
 
-	value = bpf_map_lookup_elem(&existing_map, &zero);
-
-	value = bpf_map_lookup_elem(&missing_map, &zero);
-
-	return value != NULL;
+	return bpf_map_lookup_elem(&missing_map, &zero) != NULL;
 }
 
 extern int bpf_nonexistent_kfunc(void) __ksym __weak;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ