[Devel] [PATCH VZ10 1/2] vhost/vsock: always initialize vhost_vsock->cpr_paused field

Andrey Drobyshev andrey.drobyshev at virtuozzo.com
Thu Jun 4 18:46:12 MSK 2026


The fiels isn't initialized when /dev/vhost-vsock is opened, until
VHOST_VSOCK_SET_RUNNING ioctl is called.

kvmalloc(..., GFP_KERNEL | __GFP_RETRY_MAYFAIL) does not zero memory.
Les't make sure the field is always initialized to false on device open.

Fixes: 965dba34b2a2 ("vhost/vsock: suppress EHOSTUNREACH fast-fail during CPR pause")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev at virtuozzo.com>

Feature: vhost-vsock: VHOST_RESET_OWNER ioctl
---
 drivers/vhost/vsock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 1d7c5e5acc0a..35f65b58108d 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -707,6 +707,7 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file)
 
 	vsock->guest_cid = 0; /* no CID assigned yet */
 	vsock->seqpacket_allow = false;
+	vsock->cpr_paused = false;
 
 	atomic_set(&vsock->queued_replies, 0);
 
-- 
2.47.1



More information about the Devel mailing list