Skip to content

Commit 589bd1c

Browse files
rostedtjfvogel
authored andcommitted
ring-buffer: Unlock resize on mmap error
commit 9ba0e17 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: 117c392 ("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> (cherry picked from commit abb99f28b4f0563cd6c9f4b2656fa8dff752268a) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent b8a8605 commit 589bd1c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/trace/ring_buffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7157,6 +7157,7 @@ int ring_buffer_map(struct trace_buffer *buffer, int cpu,
71577157
kfree(cpu_buffer->subbuf_ids);
71587158
cpu_buffer->subbuf_ids = NULL;
71597159
rb_free_meta_page(cpu_buffer);
7160+
atomic_dec(&cpu_buffer->resize_disabled);
71607161
}
71617162

71627163
unlock:

0 commit comments

Comments
 (0)