diff --git a/[refs] b/[refs] index dd563d866ba1..90fd90228874 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a19d35c11fd559dd7dfd5a2078df7c9af74a5d88 +refs/heads/master: c7920614cebbf269a7c8397ff959a8dcf727465c diff --git a/trunk/kernel/perf_event.c b/trunk/kernel/perf_event.c index 6ae62186dd0c..ff5d430d45a7 100644 --- a/trunk/kernel/perf_event.c +++ b/trunk/kernel/perf_event.c @@ -2593,6 +2593,14 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma) long user_extra, extra; int ret = 0; + /* + * Don't allow mmap() of inherited per-task counters. This would + * create a performance issue due to all children writing to the + * same buffer. + */ + if (event->cpu == -1 && event->attr.inherit) + return -EINVAL; + if (!(vma->vm_flags & VM_SHARED)) return -EINVAL;