summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/perf_counter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index e0d91fd..667ab25 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -2315,7 +2315,8 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
lock_limit >>= PAGE_SHIFT;
locked = vma->vm_mm->locked_vm + extra;
- if ((locked > lock_limit) && !capable(CAP_IPC_LOCK)) {
+ if ((locked > lock_limit) && perf_paranoid_tracepoint_raw() &&
+ !capable(CAP_IPC_LOCK)) {
ret = -EPERM;
goto unlock;
}