The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: syzbot <syzbot+0168fe25f9e5d46bd5fe@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	mathieu.desnoyers@efficios.com, mhiramat@kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [trace?] KCSAN: data-race in ring_buffer_unlock_commit / ring_buffer_unlock_commit
Date: Wed, 5 Aug 2026 21:43:14 -0400	[thread overview]
Message-ID: <20260805214314.256f1608@robin> (raw)
In-Reply-To: <6a715377.d35e88fd.de8b.000a.GAE@google.com>

On Mon, 03 Aug 2026 19:50:31 -0700
syzbot <syzbot+0168fe25f9e5d46bd5fe@syzkaller.appspotmail.com> wrote:

> 
> Unfortunately, I don't have any reproducer for this issue yet.

Looks to be a false positive.

> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/d1a0ae21bd78/disk-848acc8f.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/9be505d18eb6/vmlinux-848acc8f.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/8ab6a3838bc0/bzImage-848acc8f.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+0168fe25f9e5d46bd5fe@syzkaller.appspotmail.com
> 
> ==================================================================
> BUG: KCSAN: data-race in ring_buffer_unlock_commit / ring_buffer_unlock_commit
> 
> write to 0xffff888100074cb4 of 1 bytes by task 8271 on cpu 1:
>  rb_wakeups kernel/trace/ring_buffer.c:4295 [inline]
>  ring_buffer_unlock_commit+0x6a/0x440 kernel/trace/ring_buffer.c:4495
>  __buffer_unlock_commit kernel/trace/trace.h:1697 [inline]

> 
> read to 0xffff888100074cb4 of 1 bytes by task 8264 on cpu 0:
>  rb_wakeups kernel/trace/ring_buffer.c:4294 [inline]
>  ring_buffer_unlock_commit+0x54/0x440 kernel/trace/ring_buffer.c:4495
>  __buffer_unlock_commit kernel/trace/trace.h:1697 [inline]


> 
> value changed: 0x01 -> 0x00
> 

The code is this:

        if (buffer->irq_work.waiters_pending) {
                buffer->irq_work.waiters_pending = false;
                /* irq_work_queue() supplies it's own memory barriers */
                rb_irq_work_queue(&buffer->irq_work);
        }

The detection is against the reading of waiters_pending and setting of
it. When a task is waiting for data, it will set waiters_pending when
there should be a wake up, and it doesn't need to be woken up
immediately. The first writer that sees this set will call the
irq_work_queue() which has all the necessary memory barriers needed to
make sure it is queued properly. But we do not care about this data
race here. We do not need to have memory barriers here because this is
a "lazy" call. That is, it doesn't hurt if it misses the check or
multiple tasks enable it here. Things will work out later.

I guess the "fix" is to quiet this warning.

-- Steve


      reply	other threads:[~2026-08-06  1:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  2:50 [syzbot] [trace?] KCSAN: data-race in ring_buffer_unlock_commit / ring_buffer_unlock_commit syzbot
2026-08-06  1:43 ` Steven Rostedt [this message]

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=20260805214314.256f1608@robin \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=syzbot+0168fe25f9e5d46bd5fe@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox