mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
UPSTREAM: vhost/vsock: fix uninitialized vhost_vsock->guest_cid
commita72b69dc08upstream. The vhost_vsock->guest_cid field is uninitialized when /dev/vhost-vsock is opened until the VHOST_VSOCK_SET_GUEST_CID ioctl is called. kvmalloc(..., GFP_KERNEL | __GFP_RETRY_MAYFAIL) does not zero memory. All other vhost_vsock fields are initialized explicitly so just initialize this field too. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: Daniel Verkamp <dverkamp@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit258d8549b5) Bug: 121166534 Test: Ran cuttlefish with android-4.4 + VSOCKETS, VMWARE_VMCI_VSOCKETS Signed-off-by: Alistair Strachan <astrachan@google.com> Change-Id: I230006942ceb015f6549449160205cbb501b8fa6
This commit is contained in:
committed by
Alistair Strachan
parent
ea183988de
commit
b53fc49147
@@ -516,6 +516,8 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file)
|
||||
goto out;
|
||||
}
|
||||
|
||||
vsock->guest_cid = 0; /* no CID assigned yet */
|
||||
|
||||
atomic_set(&vsock->queued_replies, 0);
|
||||
|
||||
vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX];
|
||||
|
||||
Reference in New Issue
Block a user