]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vsock/virtio: read virtqueues under worker locks
authorWeiming Shi <bestswngs@gmail.com>
Wed, 29 Jul 2026 19:16:54 +0000 (12:16 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 3 Aug 2026 23:28:58 +0000 (16:28 -0700)
commitebac8f6b1ef0e9278afe204b8692a7479988dace
tree75e4cbd2365e7a26905ffd44f2625f1f920f7c64
parentd1000fd7995e51deec872d154e0a40d82f7a539f
vsock/virtio: read virtqueues under worker locks

Commit bd50c5dc182b ("vsock/virtio: add support for device
suspend/resume") made the *_run flags transition from false to true when
restore installs replacement virtqueues.  The RX, TX and event workers
read their virtqueue before locking and checking the corresponding flag,
so a worker delayed across freeze and restore can observe the replacement
queue's running state while retaining a pointer to the deleted queue.

Read each virtqueue under its mutex after checking the run flag, keeping
the pointer and state in the same queue generation.

Fixes: bd50c5dc182b ("vsock/virtio: add support for device suspend/resume")
Cc: stable@vger.kernel.org
Reported-by: Xiang Mei <xmei5@asu.edu>
Link: https://lore.kernel.org/r/20260727035804.1860862-1-bestswngs@gmail.com
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/e79f68ad9284c983364fc3ac46904b6d9ef50231.1785352330.git.bestswngs@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/vmw_vsock/virtio_transport.c