]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf/aux: Fix AUX buffer serialization
authorPeter Zijlstra <peterz@infradead.org>
Mon, 2 Sep 2024 08:14:24 +0000 (10:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:42 +0000 (11:11 +0200)
commitc4b69bee3f4ef76809288fe6827bc14d4ae788ef
treeae2f2c3cc038fece8200e23987de8cec54d3324c
parent9faed52b98e11fb2638b6d252f1a0d7fd7de691f
perf/aux: Fix AUX buffer serialization

commit 2ab9d830262c132ab5db2f571003d80850d56b2a upstream.

Ole reported that event->mmap_mutex is strictly insufficient to
serialize the AUX buffer, add a per RB mutex to fully serialize it.

Note that in the lock order comment the perf_event::mmap_mutex order
was already wrong, that is, it nesting under mmap_lock is not new with
this patch.

Fixes: 45bfb2e50471 ("perf: Add AUX area to ring buffer for raw data streams")
Reported-by: Ole <ole@binarygecko.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/events/core.c
kernel/events/internal.h
kernel/events/ring_buffer.c