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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241104050007.13812-3-skb99@linux.ibm.com>
Date: Mon,  4 Nov 2024 10:30:06 +0530
From: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
To: bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc: ast@...nel.org, hbathini@...ux.ibm.com, andrii@...nel.org,
        daniel@...earbox.net, martin.lau@...ux.dev, eddyz87@...il.com,
        song@...nel.org, yonghong.song@...ux.dev, john.fastabend@...il.com,
        kpsingh@...nel.org, sdf@...ichev.me, haoluo@...gle.com,
        jolsa@...nel.org, shuah@...nel.org, mykolal@...com
Subject: [PATCH 2/3] libbpf: Remove powerpc prefix from syscall function names

Since commit 94746890202cf ("powerpc: Don't add __powerpc_ prefix to
syscall entry points") drops _powerpc prefix to syscall entry points,
even though powerpc now supports syscall wrapper, so /proc/kallsyms
have symbols for syscall entry without powerpc prefix(sys_*).

For this reason, arch specific prefix for syscall functions in powerpc
is dropped.

Signed-off-by: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
---
 tools/lib/bpf/libbpf.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 219facd0e66e..3a370fa37d8a 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -11110,9 +11110,7 @@ static const char *arch_specific_syscall_pfx(void)
 #elif defined(__riscv)
 	return "riscv";
 #elif defined(__powerpc__)
-	return "powerpc";
-#elif defined(__powerpc64__)
-	return "powerpc64";
+	return "";
 #else
 	return NULL;
 #endif
@@ -11127,7 +11125,11 @@ int probe_kern_syscall_wrapper(int token_fd)
 	if (!ksys_pfx)
 		return 0;
 
+#if defined(__powerpc__)
+	snprintf(syscall_name, sizeof(syscall_name), "sys_bpf");
+#else
 	snprintf(syscall_name, sizeof(syscall_name), "__%s_sys_bpf", ksys_pfx);
+#endif
 
 	if (determine_kprobe_perf_type() >= 0) {
 		int pfd;
@@ -11272,8 +11274,12 @@ struct bpf_link *bpf_program__attach_ksyscall(const struct bpf_program *prog,
 		 * compiler does not know that we have an explicit conditional
 		 * as well.
 		 */
+#if defined(__powerpc__)
+		snprintf(func_name, sizeof(func_name), "sys_%s", syscall_name);
+#else
 		snprintf(func_name, sizeof(func_name), "__%s_sys_%s",
 			 arch_specific_syscall_pfx() ? : "", syscall_name);
+#endif
 	} else {
 		snprintf(func_name, sizeof(func_name), "__se_sys_%s", syscall_name);
 	}
-- 
2.43.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ