Linux virtualization list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nguyen Dinh Phi" <phind.uet@gmail.com>
Cc: virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH net v2] vhost/vsock: annotate lockless accesses to guest_cid
Date: Sun, 29 Nov 2026 05:13:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-239329@kernel.org> (raw)
In-Reply-To: <20261129050514.1278990-1-phind.uet@gmail.com>

> vhost_vsock.guest_cid is written by vhost_vsock_set_cid() under
> vhost_vsock_mutex, but it is also read without that mutex in
> vhost_vsock_handle_tx_kick(), and vhost_vsock_get().
> 
> KCSAN will report data-race if we issue VHOST_VSOCK_SET_GUEST_CID
> ioctl while the device has TX traffic. For example:
> 
>   write to 0xffff88810f1596ac of 4 bytes by task 7914 on cpu 1:
>    vhost_vsock_dev_ioctl+0x25f/0x720
>    __x64_sys_ioctl+0xc2/0x110
>    x64_sys_call+0x299/0x20a0
>    do_syscall_64+0xc9/0x510
>    entry_SYSCALL_64_after_hwframe+0x76/0x7e
> 
>   read to 0xffff88810f1596ac of 4 bytes by task 7910 on cpu 3:
> [ ... ]
> READ_ONCE(). This also guards against compiler re-fetching or tearing 
> if the surrounding code is refactored in the future. 
> 
> Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
> Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129050514.1278990-1-phind.uet@gmail.com?part=1

      reply	other threads:[~2026-11-29  5:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  5:05 [PATCH net v2] vhost/vsock: annotate lockless accesses to guest_cid Nguyen Dinh Phi
2026-11-29  5:13 ` sashiko-bot [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=sashiko-outbox-239329@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=phind.uet@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=virtualization@lists.linux.dev \
    /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