Skip to content

Commit 44d2989

Browse files
ImV4belgregkh
authored andcommitted
vsock/virtio: Initialization of the dangling pointer occurring in vsk->trans
commit 6ca575374dd9a507cdd16dfa0e78c2e9e20bd05f upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 98d8dde commit 44d2989

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
@@ -827,6 +827,7 @@ void virtio_transport_destruct(struct vsock_sock *vsk)
827827
struct virtio_vsock_sock *vvs = vsk->trans;
828828

829829
kfree(vvs);
830+
vsk->trans = NULL;
830831
}
831832
EXPORT_SYMBOL_GPL(virtio_transport_destruct);
832833

0 commit comments

Comments
 (0)