Files
i2som-imx-linux/include/linux
Peter Zijlstra 7edcd18138 perf: Fix perf mmap bugs
commit 26cb63ad11 upstream.

Vince reported a problem found by his perf specific trinity
fuzzer.

Al noticed 2 problems with perf's mmap():

 - it has issues against fork() since we use vma->vm_mm for accounting.
 - it has an rb refcount leak on double mmap().

We fix the issues against fork() by using VM_DONTCOPY; I don't
think there's code out there that uses this; we didn't hear
about weird accounting problems/crashes. If we do need this to
work, the previously proposed VM_PINNED could make this work.

Aside from the rb reference leak spotted by Al, Vince's example
prog was indeed doing a double mmap() through the use of
perf_event_set_output().

This exposes another problem, since we now have 2 events with
one buffer, the accounting gets screwy because we account per
event. Fix this by making the buffer responsible for its own
accounting.

[Backporting for 3.4-stable.
VM_RESERVED flag was replaced with pair 'VM_DONTEXPAND | VM_DONTDUMP' in
314e51b9 since 3.7.0-rc1, and 314e51b9 comes from a big patchset, we didn't
backport the patchset, so I restored 'VM_DNOTEXPAND | VM_DONTDUMP' as before:
-       vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP;
+       vma->vm_flags |= VM_DONTCOPY | VM_RESERVED;
 -- zliu]

Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Link: http://lkml.kernel.org/r/20130528085548.GA12193@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Zhouping Liu <zliu@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2013-07-27 05:34:32 +01:00
..
2012-11-16 16:46:48 +00:00
2011-11-16 09:21:50 +01:00
2012-02-20 12:46:20 -08:00
2012-08-02 14:37:54 +01:00
2011-11-07 23:54:53 +01:00
2012-02-29 16:31:24 -08:00
2013-01-03 03:32:57 +00:00
2011-11-23 11:33:07 +01:00
2013-03-06 03:23:57 +00:00
2012-08-10 00:11:14 +01:00
2012-07-25 04:11:19 +01:00
2013-03-06 03:24:27 +00:00
2013-04-25 20:25:38 +01:00
2012-04-02 09:52:34 -07:00
2012-10-10 03:30:45 +01:00
2013-01-03 03:32:54 +00:00
2013-05-13 15:02:33 +01:00
2013-07-27 05:34:29 +01:00
2013-04-25 20:25:40 +01:00
2012-01-25 16:13:17 -08:00
2012-02-06 09:41:06 -08:00
2013-07-27 05:34:32 +01:00
2011-11-22 16:37:01 -05:00
2011-11-29 11:59:50 +00:00
2013-01-16 01:13:25 +00:00
2012-07-12 04:31:59 +01:00
2012-07-25 04:11:32 +01:00