FROMLIST: security,perf: Allow further restriction of perf_event_open
authorJeff Vander Stoep <jeffv@google.com>
Sun, 29 May 2016 21:22:32 +0000 (14:22 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 16 Jun 2016 08:14:10 +0000 (13:44 +0530)
commit934f4983c760c38be86ea5e9a008db8a66395eca
treee93de1843c1186dfb1b7113cf96ce5b612e389fc
parent690829a7aded2df9907edbdbf7c18b0f1556066e
FROMLIST: security,perf: Allow further restriction of perf_event_open

When kernel.perf_event_open is set to 3 (or greater), disallow all
access to performance events by users without CAP_SYS_ADMIN.
Add a Kconfig symbol CONFIG_SECURITY_PERF_EVENTS_RESTRICT that
makes this value the default.

This is based on a similar feature in grsecurity
(CONFIG_GRKERNSEC_PERF_HARDEN).  This version doesn't include making
the variable read-only.  It also allows enabling further restriction
at run-time regardless of whether the default is changed.

https://lkml.org/lkml/2016/1/11/587

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Bug: 29054680
Change-Id: Iff5bff4fc1042e85866df9faa01bce8d04335ab8
Documentation/sysctl/kernel.txt
include/linux/perf_event.h
kernel/events/core.c
security/Kconfig