Skip to content

Commit 6609228

Browse files
V4bel-theoriyifei-aws
authored andcommitted
hv_sock: Initializing vsk->trans to NULL to prevent a dangling pointer
commit e629295 upstream. 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 <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Link: https://patch.msgid.link/Zys4hCj61V+mQfX2@v4bel-B760M-AORUS-ELITE-AX Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> [ Clean cherry-pick ] Signed-off-by: Stanislav Uschakow <[email protected]>
1 parent a94ebee commit 6609228

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/vmw_vsock/hyperv_transport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ static void hvs_destruct(struct vsock_sock *vsk)
511511
vmbus_hvsock_device_unregister(chan);
512512

513513
kfree(hvs);
514+
vsk->trans = NULL;
514515
}
515516

516517
static int hvs_dgram_bind(struct vsock_sock *vsk, struct sockaddr_vm *addr)

0 commit comments

Comments
 (0)