Skip to content

Commit

Permalink
hv_sock: Initializing vsk->trans to NULL to prevent a dangling pointer
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
V4bel-theori authored and gregkh committed Nov 14, 2024
1 parent f7a08b2 commit 4bdc5a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/vmw_vsock/hyperv_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ static void hvs_destruct(struct vsock_sock *vsk)
vmbus_hvsock_device_unregister(chan);

kfree(hvs);
vsk->trans = NULL;
}

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

0 comments on commit 4bdc5a6

Please sign in to comment.