From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marco Elver <elver@google.com>
Cc: syzbot <syzbot+8a02104389c2e0ef5049@syzkaller.appspotmail.com>,
eperezma@redhat.com, jasowang@redhat.com,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
virtualization@lists.linux.dev, xuanzhuo@linux.alibaba.com
Subject: Re: [syzbot] [virt?] KCSAN: data-race in virtqueue_disable_cb / vring_interrupt (4)
Date: Thu, 12 Sep 2024 11:00:12 -0400 [thread overview]
Message-ID: <20240912105002-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CANpmjNOGpVXXdi61vFJDPB4CHsd3ksotjdQHO6WiVXV2m-aABg@mail.gmail.com>
On Thu, Sep 12, 2024 at 04:46:28PM +0200, Marco Elver wrote:
> On Thu, 12 Sept 2024 at 16:34, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Thu, Sep 12, 2024 at 03:48:32PM +0200, Marco Elver wrote:
> > > On Thu, 12 Sept 2024 at 13:03, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > >
> > > > On Thu, Sep 12, 2024 at 01:11:21AM -0700, syzbot wrote:
> > > > > Hello,
> > > > >
> > > > > syzbot found the following issue on:
> > > > >
> > > > > HEAD commit: 7c6a3a65ace7 minmax: reduce min/max macro expansion in ato..
> > > > > git tree: upstream
> > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=1608e49f980000
> > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=1e7d02549be622b2
> > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=8a02104389c2e0ef5049
> > > > > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> > > > >
> > > > > Unfortunately, I don't have any reproducer for this issue yet.
> > > > >
> > > > > Downloadable assets:
> > > > > disk image: https://storage.googleapis.com/syzbot-assets/a1f7496fa21f/disk-7c6a3a65.raw.xz
> > > > > vmlinux: https://storage.googleapis.com/syzbot-assets/f423739e51a9/vmlinux-7c6a3a65.xz
> > > > > kernel image: https://storage.googleapis.com/syzbot-assets/b65a0f38cbd7/bzImage-7c6a3a65.xz
> > > > >
> > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > > > > Reported-by: syzbot+8a02104389c2e0ef5049@syzkaller.appspotmail.com
> > > > >
> > > > > ==================================================================
> > > > > BUG: KCSAN: data-race in virtqueue_disable_cb / vring_interrupt
> > > > >
> > > > > write to 0xffff88810285ef52 of 1 bytes by interrupt on cpu 0:
> > > > > vring_interrupt+0x12b/0x180 drivers/virtio/virtio_ring.c:2591
> > > >
> > > >
> > > > Yes, it's racy!
> > > >
> > > > 2589: /* Just a hint for performance: so it's ok that this can be racy! */
> > > > 2590: if (vq->event)
> > > > 2591: vq->event_triggered = true;
> > > >
> > > >
> > > > Question: is there a way to annotate code to tell syzbot it's ok?
> > >
> > > In this case, "if (data_race(vq->event))" might be the right choice.
> >
> > No, vq->event is not racy.
>
> Oops - yes.
>
> > The race is between a write and a read of event_triggered.
> > I think data_race tags a read, it can not tag a write, correct?
>
> data_race() takes an expression, so either read or write can be
> enclosed - e.g. "data_race(vq->event_triggered = true);" works as
> well.
Ah, good to know. Yes, I see it is basically __kcsan_disable_current +
__kcsan_enable_current. Will do.
--
MST
next prev parent reply other threads:[~2024-09-12 15:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 8:11 [syzbot] [virt?] KCSAN: data-race in virtqueue_disable_cb / vring_interrupt (4) syzbot
2024-09-12 11:03 ` Michael S. Tsirkin
2024-09-12 13:48 ` Marco Elver
2024-09-12 14:34 ` Michael S. Tsirkin
2024-09-12 14:46 ` Marco Elver
2024-09-12 15:00 ` Michael S. Tsirkin [this message]
2024-09-12 14:46 ` Michael S. Tsirkin
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=20240912105002-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=elver@google.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+8a02104389c2e0ef5049@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).