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-prev] [day] [month] [year] [list]
Message-Id: <20221102070506.1403-1-mrpre@163.com>
Date:   Wed,  2 Nov 2022 07:05:06 +0000
From:   mrpre <mrpre@....com>
To:     daniel@...earbox.net, stephen@...workplumber.org
Cc:     netdev@...r.kernel.org, mrpre <mrpre@....com>
Subject: [PATCH iproute2 v2] fix missing map name when creating eBPF maps

fix missing map name when creating eBPF maps

Signed-off-by: Chen Jiayuan <mrpre@....com>
---
 lib/bpf_legacy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c
index 4fabdcc8..0fff035b 100644
--- a/lib/bpf_legacy.c
+++ b/lib/bpf_legacy.c
@@ -1264,7 +1264,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
 			  uint32_t size_value, uint32_t max_elem,
 			  uint32_t flags, int inner_fd, int btf_fd,
 			  uint32_t ifindex, uint32_t btf_id_key,
-			  uint32_t btf_id_val)
+			  uint32_t btf_id_val, const char *name)
 {
 	union bpf_attr attr = {};
 
@@ -1278,6 +1278,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
 	attr.btf_fd = btf_fd;
 	attr.btf_key_type_id = btf_id_key;
 	attr.btf_value_type_id = btf_id_val;
+	strncpy(attr.map_name, name, sizeof(attr.map_name));
 
 	return bpf(BPF_MAP_CREATE, &attr, sizeof(attr));
 }
@@ -1682,7 +1683,7 @@ probe:
 	errno = 0;
 	fd = bpf_map_create(map->type, map->size_key, map->size_value,
 			    map->max_elem, map->flags, map_inner_fd, ctx->btf_fd,
-			    ifindex, ext->btf_id_key, ext->btf_id_val);
+			    ifindex, ext->btf_id_key, ext->btf_id_val, name);
 
 	if (fd < 0 || ctx->verbose) {
 		bpf_map_report(fd, name, map, ctx, map_inner_fd);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ