]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf: Revert to requiring CAP_SYS_ADMIN for uprobes
authorPeter Zijlstra <peterz@infradead.org>
Wed, 2 Jul 2025 16:21:44 +0000 (18:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:27:52 +0000 (18:27 +0200)
commitd7ef1afd5b3f43f4924326164cee5397b66abd9c
treed21c79cf348174d95733a47b6b0e6224ba55510e
parent8f2d162c4bcfdbb23489f26c7650c7a241c050c4
perf: Revert to requiring CAP_SYS_ADMIN for uprobes

[ Upstream commit ba677dbe77af5ffe6204e0f3f547f3ba059c6302 ]

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: c9e0924e5c2b ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/events/core.c