]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ring-buffer: Fix to update per-subbuf entries of persistent ring buffer
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Thu, 19 Mar 2026 09:12:19 +0000 (18:12 +0900)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sat, 21 Mar 2026 20:47:28 +0000 (16:47 -0400)
Since the validation loop in rb_meta_validate_events() updates the same
cpu_buffer->head_page->entries, the other subbuf entries are not updated.
Fix to use head_page to update the entries field, since it is the cursor
in this loop.

Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Ian Rogers <irogers@google.com>
Fixes: 5f3b6e839f3c ("ring-buffer: Validate boot range memory events")
Link: https://patch.msgid.link/177391153882.193994.17158784065013676533.stgit@mhiramat.tok.corp.google.com
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c

index 17d0ea0cc3e6f649e5a2a55b453b7f5801d0a7ac..170170bd83bd9c1e2b27b4c79a89409aba0cc333 100644 (file)
@@ -2053,7 +2053,7 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer)
 
                entries += ret;
                entry_bytes += local_read(&head_page->page->commit);
-               local_set(&cpu_buffer->head_page->entries, ret);
+               local_set(&head_page->entries, ret);
 
                if (head_page == cpu_buffer->commit_page)
                        break;