mirror-linux/kernel/events
Peter Zijlstra ba677dbe77 perf: Revert to requiring CAP_SYS_ADMIN for uprobes
Jann reports that uprobes can be used destructively when used in the
middle of an instruction. The kernel only verifies there is a valid
instruction at the requested offset, but due to variable instruction
length cannot determine if this is an instruction as seen by the
intended execution stream.

Additionally, Mark Rutland notes that on architectures that mix data
in the text segment (like arm64), a similar things can be done if the
data word is 'mistaken' for an instruction.

As such, require CAP_SYS_ADMIN for uprobes.

Fixes: c9e0924e5c ("perf/core: open access to probes for CAP_PERFMON privileged process")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/CAG48ez1n4520sq0XrWYDHKiKxE_+WCfAK+qt9qkY4ZiBGmL-5g@mail.gmail.com
2025-07-03 10:33:55 +02:00
..
Makefile perf/hw_breakpoint: Add KUnit test for constraints accounting 2022-08-30 10:56:20 +02:00
callchain.c perf/core: Move perf_event sysctls into kernel/events 2025-02-21 14:53:02 +01:00
core.c perf: Revert to requiring CAP_SYS_ADMIN for uprobes 2025-07-03 10:33:55 +02:00
hw_breakpoint.c perf/hw_breakpoint: Return EOPNOTSUPP for unsupported breakpoint type 2025-03-04 09:42:13 +01:00
hw_breakpoint_test.c perf/hw_breakpoint: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:52 -07:00
internal.h perf/core: Add aux_pause, aux_resume, aux_start_paused 2024-11-05 12:55:43 +01:00
ring_buffer.c perf/aux: Fix pending disable flow when the AUX ring buffer overruns 2025-06-26 10:50:37 +02:00
uprobes.c kernel/events/uprobes: uprobe_write_opcode() rewrite 2025-05-11 17:48:18 -07:00