summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2025-02-13 13:19:57 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-21 14:01:29 +0100
commitabb99f28b4f0563cd6c9f4b2656fa8dff752268a (patch)
tree584a77ee8394a4787e91b4c8f5de4689387ee1fd /kernel
parent71762f455a81141b5412b25d5edfb71f01e68bcf (diff)
downloadlinux-abb99f28b4f0563cd6c9f4b2656fa8dff752268a.tar.gz
linux-abb99f28b4f0563cd6c9f4b2656fa8dff752268a.tar.bz2
linux-abb99f28b4f0563cd6c9f4b2656fa8dff752268a.zip
ring-buffer: Unlock resize on mmap error
commit 9ba0e1755a40f9920ad0f4168031291b3eb58d7b upstream. Memory mapping the tracing ring buffer will disable resizing the buffer. But if there's an error in the memory mapping like an invalid parameter, the function exits out without re-enabling the resizing of the ring buffer, preventing the ring buffer from being resized after that. Cc: stable@vger.kernel.org Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Vincent Donnefort <vdonnefort@google.com> Link: https://lore.kernel.org/20250213131957.530ec3c5@gandalf.local.home Fixes: 117c39200d9d7 ("ring-buffer: Introducing ring-buffer mapping functions") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ring_buffer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 0f8f3ffc6f09..e4bfab9777b3 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -7157,6 +7157,7 @@ int ring_buffer_map(struct trace_buffer *buffer, int cpu,
kfree(cpu_buffer->subbuf_ids);
cpu_buffer->subbuf_ids = NULL;
rb_free_meta_page(cpu_buffer);
+ atomic_dec(&cpu_buffer->resize_disabled);
}
unlock: