Skip to content

Commit 0161028

Browse files
amlutotorvalds
authored andcommitted
perf/core: Change the default paranoia level to 2
Allowing unprivileged kernel profiling lets any user dump follow kernel control flow and dump kernel registers. This most likely allows trivial kASLR bypassing, and it may allow other mischief as well. (Off the top of my head, the PERF_SAMPLE_REGS_INTR output during /dev/urandom reads could be quite interesting.) Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5c56b56 commit 0161028

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/sysctl/kernel.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ allowed to execute.
645645
perf_event_paranoid:
646646

647647
Controls use of the performance events system by unprivileged
648-
users (without CAP_SYS_ADMIN). The default value is 1.
648+
users (without CAP_SYS_ADMIN). The default value is 2.
649649

650650
-1: Allow use of (almost) all events by all users
651651
>=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK

kernel/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static struct srcu_struct pmus_srcu;
351351
* 1 - disallow cpu events for unpriv
352352
* 2 - disallow kernel profiling for unpriv
353353
*/
354-
int sysctl_perf_event_paranoid __read_mostly = 1;
354+
int sysctl_perf_event_paranoid __read_mostly = 2;
355355

356356
/* Minimum for 512 kiB + 1 user control page */
357357
int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */

0 commit comments

Comments
 (0)