perf: Require kernel access for text poke events
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e17d43b93e544f5016c0251d2074c15568d5d963 · < e506333d1b9f42f1e402acebf1283af3c44a3809| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
perf: Require kernel access for text poke events
Perf events with exclude_kernel=1 can be opened without kernel perf access. However, exclude_kernel does not suppress text-poke sideband records. Every PERF_RECORD_TEXT_POKE is marked PERF_RECORD_MISC_KERNEL and contains a raw kernel instruction address.
An unprivileged task can therefore open and mmap a task-local software event with text_poke=1. Both opening a count-only tracepoint event and configuring UDP GRO for ESP-in-UDP cause updates to inline static calls; the observer receives the relocated addresses of the modified instructions. For a known kernel image, any such address reveals the runtime kernel text base despite KASLR.
Call perf_allow_kernel() whenever attr.text_poke is set, regardless of exclude_kernel. Events that neither monitor kernel execution nor request text-poke records retain their existing permissions.
From the CVE record · Linux
Linux kernel perf events can expose kernel instruction addresses through text-poke records even when kernel events are excluded. A local unprivileged attacker can use these records to determine the runtime kernel text base and bypass KASLR for a known kernel image; no user interaction is described.
Engineers running Linux kernels with perf text-poke events should check whether their kernels are affected; no affected versions are specified.