Skip to content

Commit 5f97093

Browse files
ImV4belgregkh
authored andcommitted
vsock/virtio: Initialization of the dangling pointer occurring in vsk->trans
commit 6ca5753 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 <stable@kernel.org> Fixes: 06a8fc7 ("VSOCK: Introduce virtio_vsock_common.ko") Signed-off-by: Hyunwoo Kim <v4bel@theori.io> Signed-off-by: Wongi Lee <qwerty@theori.io> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Message-Id: <2024102245-strive-crib-c8d3@gregkh> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e0fe339 commit 5f97093

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/vmw_vsock/virtio_transport_common.c

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

10891089
kfree(vvs);
1090+
vsk->trans = NULL;
10901091
}
10911092
EXPORT_SYMBOL_GPL(virtio_transport_destruct);
10921093

0 commit comments

Comments
 (0)