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 <[email protected]>

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

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to