lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260127103716-mutt-send-email-mst@kernel.org>
Date: Tue, 27 Jan 2026 10:44:50 -0500
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Johannes Thumshirn <johannes.thumshirn@....com>
Cc: virtualization@...ts.linux.dev, Jason Wang <jasowang@...hat.com>,
	Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
	Eugenio Pérez <eperezma@...hat.com>,
	Alexander Graf <graf@...zon.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 0/2] virtio: silence KCSAN warnings

On Tue, Jan 27, 2026 at 04:25:21PM +0100, Johannes Thumshirn wrote:
> When booting a Qemu VM whith KCSAN to debug filesystem races I
> encountered a bunch of KCSAN splats in virtio.
> 
> All of them are false positives, as the racy unknown origin is the
> hypervisor.
> 
> Alex suggested to annotate the vring structure as racy for KCSAN, but
> the __data_racy annotation turns into "volatile" and as such it cannot
> be used to annotate the whole structure. Annotating every structure
> embedding a pointer to the vring turned out to be way more invasive than
> annotating only the few sites consumers.

Oh wow and I learned Linux has

# define auto __auto_type

which then allows auto in G11:

#define data_race(expr)                                                 \
({                                                                      \
        __kcsan_disable_current();                                      \
        auto __v = (expr);                                              \
        __kcsan_enable_current();                                       \
        __v;                                                            \
})




> Changes to v1:
> - Annotate the return of more_used_split() as racy so both call sites
>   are covered
> - Annotate vring_avail_event() as racy so we can condense two patches
>   into one.

Acked-by: Michael S. Tsirkin <mst@...hat.com>

I will pick this up.

> Link to v1:
> https://lore.kernel.org/virtualization/20260127083926.865555-1-johannes.thumshirn@wdc.com/
> 
> Johannes Thumshirn (2):
>   virtio: silence KCSAN warning in virtqueue_get_buf_ctx_split
>   virtio: silence KCSAN warning in virtqueue_kick_prepare
> 
>  drivers/virtio/virtio_ring.c     | 4 ++--
>  include/uapi/linux/virtio_ring.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> -- 
> 2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ