public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Zhang Tianci <zhangtianci.1997@bytedance.com>
Cc: mst@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
	 marco.crivellari@suse.com, anders.roxell@linaro.org,
	 virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org, Xie Yongji <xieyongji@bytedance.com>
Subject: Re: [PATCH v4 2/2] vduse: Fix race in vduse_dev_msg_sync and vduse_dev_read_iter
Date: Wed, 4 Mar 2026 15:00:53 +0800	[thread overview]
Message-ID: <CACGkMEtduDsnZjGhOYwdRpOBVxX=+2z4C4sJ47KwROF7NWNzcw@mail.gmail.com> (raw)
In-Reply-To: <20260226115550.1814-3-zhangtianci.1997@bytedance.com>

On Thu, Feb 26, 2026 at 7:56 PM Zhang Tianci
<zhangtianci.1997@bytedance.com> wrote:
>
> There is one race case in vduse_dev_msg_sync and vduse_dev_read_iter:
>
> vduse_dev_read_iter():
>     lock(msg_lock);
>     dequeue_msg(send_list);
>     unlock(msg_lock);
> vduse_dev_msg_sync():
>     wait_timeout() finish
>     lock(msg_lock);
>     check msg->complete is false
>         list_del(msg);   <- double list_del() crash!
>
> To fix this case, we shall ensure vduse_msg is on send_list or recv_list
> outside the msg_lock critical section.
>
> Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhang Tianci <zhangtianci.1997@bytedance.com>
> Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
> ---

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks


      reply	other threads:[~2026-03-04  7:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 11:55 [PATCH v4 0/2] vduse: Fix race in vduse_dev_msg_sync and vduse_dev_read_iter Zhang Tianci
2026-02-26 11:55 ` [PATCH v4 1/2] vduse: Requeue failed read to send_list head Zhang Tianci
2026-03-04  5:56   ` Jason Wang
2026-02-26 11:55 ` [PATCH v4 2/2] vduse: Fix race in vduse_dev_msg_sync and vduse_dev_read_iter Zhang Tianci
2026-03-04  7:00   ` Jason Wang [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='CACGkMEtduDsnZjGhOYwdRpOBVxX=+2z4C4sJ47KwROF7NWNzcw@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=anders.roxell@linaro.org \
    --cc=eperezma@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.crivellari@suse.com \
    --cc=mst@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=virtualization@lists.linux.dev \
    --cc=xieyongji@bytedance.com \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=zhangtianci.1997@bytedance.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