Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hv_sock: Initializing vsk->trans to NULL to prevent a dangling pointer

When hvs is released, there is a possibility that vsk->trans may not
be initialized to NULL, which could lead to a dangling pointer.
This issue is resolved by initializing vsk->trans to NULL.

Signed-off-by: Hyunwoo Kim <v4bel@theori.io>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/Zys4hCj61V+mQfX2@v4bel-B760M-AORUS-ELITE-AX
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Hyunwoo Kim and committed by
Jakub Kicinski
e629295b 9dae5921

+1
+1
net/vmw_vsock/hyperv_transport.c
··· 549 549 vmbus_hvsock_device_unregister(chan); 550 550 551 551 kfree(hvs); 552 + vsk->trans = NULL; 552 553 } 553 554 554 555 static int hvs_dgram_bind(struct vsock_sock *vsk, struct sockaddr_vm *addr)