Skip to content

Commit 6ca5753

Browse files
ImV4belmstsirkin
authored andcommitted
vsock/virtio: Initialization of the dangling pointer occurring in vsk->trans
During loopback communication, a dangling pointer can be created in vsk->trans, potentially leading to a Use-After-Free condition. This issue is resolved by initializing vsk->trans to NULL. Cc: stable <[email protected]> Fixes: 06a8fc7 ("VSOCK: Introduce virtio_vsock_common.ko") Signed-off-by: Hyunwoo Kim <[email protected]> Signed-off-by: Wongi Lee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Message-Id: <2024102245-strive-crib-c8d3@gregkh> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 59b723c commit 6ca5753

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/vmw_vsock/virtio_transport_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ void virtio_transport_destruct(struct vsock_sock *vsk)
11091109
struct virtio_vsock_sock *vvs = vsk->trans;
11101110

11111111
kfree(vvs);
1112+
vsk->trans = NULL;
11121113
}
11131114
EXPORT_SYMBOL_GPL(virtio_transport_destruct);
11141115

0 commit comments

Comments
 (0)