From: Breno Leitao <leitao@debian.org>
To: sashiko-bot@kernel.org, rostedt@goodmis.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
Linux trace kernel <linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH] ring-buffer: Do not allow reader to see unfinished moved head
Date: Mon, 9 Nov 2026 05:04:50 -0800 [thread overview]
Message-ID: <avHEs_umssItSLHi@gmail.com> (raw)
In-Reply-To: <sashiko-outbox-204599@kernel.org>
Steve,
Thank for the patch,
On Mon, Nov 09, 2026 at 08:39:43AM +0000, sashiko-bot@kernel.org wrote:
> > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> > index e760d2fe386fb..cf9e0dc10c88f 100644
> > --- a/kernel/trace/ring_buffer.c
> > +++ b/kernel/trace/ring_buffer.c
> > @@ -1494,7 +1494,13 @@ rb_set_head_page(struct ring_buffer_per_cpu *cpu_buffer)
> > if (RB_WARN_ON(cpu_buffer, rb_list_head(list->prev->next) != list))
> > return NULL;
> >
> > - page = head = cpu_buffer->head_page;
> > + /*
> > + * Make sure that the start of the search of the head_page does not
> > + * start between the writer adding the UPDATE and the new HEAD that it
> > + * moves forward.
> > + */
> > + /* Sync with the writer moving the HEAD in rb_handle_head_page() */
> > + page = head = smp_load_acquire(&cpu_buffer->head_page);
>
> [Severity: Medium]
> Can the reader's non-atomic update of cpu_buffer->head_page in
> __rb_get_reader_page() race with the writer's new store in
> rb_handle_head_page() and advance cpu_buffer->head_page past the sub-buffer
> marked for update?
I've asked my robot to test this case, and it was still able to
reproduce the race, even with this patch.
next prev parent reply other threads:[~2026-11-09 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 8:22 [PATCH] ring-buffer: Do not allow reader to see unfinished moved head Steven Rostedt
2026-11-09 8:39 ` sashiko-bot
2026-11-09 13:04 ` Breno Leitao [this message]
2026-11-10 8:00 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avHEs_umssItSLHi@gmail.com \
--to=leitao@debian.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=sashiko-bot@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.