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]
Date:   Sun, 4 Sep 2022 11:28:15 +0100
From:   Jules Irenge <jbi.octave@...il.com>
To:     ast@...nel.org
Cc:     memxor@...il.com, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, daniel@...earbox.net, martin.lau@...ux.dev,
        Elana.Copperman@...ileye.com
Subject: [PATCH bpf-next] Fixes: 14a324f6a67e ("bpf: Wire up freeing of
 referenced kptr")

This patch fixes a warning generated by Sparse

"warning: Using plain integer as NULL pointer"

by replacing p with *p in the WRITE_ONCE() macro

This enables the pointer to be cleared on map value delete,
hence clearing the warning.

Signed-off-by: Jules Irenge <jbi.octave@...il.com>
---
 kernel/bpf/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 27760627370d..f798acd43a28 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -598,7 +598,7 @@ void bpf_map_free_kptrs(struct bpf_map *map, void *map_value)
 		if (off_desc->type == BPF_KPTR_UNREF) {
 			u64 *p = (u64 *)btf_id_ptr;
 
-			WRITE_ONCE(p, 0);
+			WRITE_ONCE(*p, 0);
 			continue;
 		}
 		old_ptr = xchg(btf_id_ptr, 0);
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ