Thread (9 messages) 9 messages, 4 authors, 2025-02-26
STALE466d

[PATCH linux-next 2/2] perf: Return EACCESS when need perfmon capability

From: Luo Gengkun <hidden>
Date: 2024-12-23 06:57:53
Also in: linux-arm-kernel, linux-perf-users, linux-trace-kernel, lkml, selinux
Subsystem: performance events subsystem, the rest · Maintainers: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Linus Torvalds

For perf_allow_kernel and perf_allow_cpu, both return EACCES when require
CAP_PERFMON or CAP_SYS_ADMIN permissions, so update perf_allow_tracepoint
to keep them the same.

Signed-off-by: Luo Gengkun <redacted>
---
 include/linux/perf_event.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 5d2ec4283ebf..c1bc0d7a275b 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1685,7 +1685,7 @@ static inline int perf_allow_cpu(void)
 static inline int perf_allow_tracepoint(void)
 {
 	if (sysctl_perf_event_paranoid > -1 && !perfmon_capable())
-		return -EPERM;
+		return -EACCES;
 
 	return security_perf_event_open(PERF_SECURITY_TRACEPOINT);
 }
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help