[SRU][F/J/N/O][PATCH 1/1] vsock/virtio: Initialization of the dangling pointer occurring in vsk->trans

Magali Lemes magali.lemes at canonical.com
Mon Nov 25 15:38:33 UTC 2024


From: Hyunwoo Kim <v4bel at theori.io>

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 at kernel.org>
Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Signed-off-by: Hyunwoo Kim <v4bel at theori.io>
Signed-off-by: Wongi Lee <qwerty at theori.io>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Message-Id: <2024102245-strive-crib-c8d3 at gregkh>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
(cherry picked from commit 6ca575374dd9a507cdd16dfa0e78c2e9e20bd05f)
CVE-2024-50264
Signed-off-by: Magali Lemes <magali.lemes at canonical.com>
---
 net/vmw_vsock/virtio_transport_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 16ff976a86e3..3b230d142ff3 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1087,6 +1087,7 @@ void virtio_transport_destruct(struct vsock_sock *vsk)
 	struct virtio_vsock_sock *vvs = vsk->trans;
 
 	kfree(vvs);
+	vsk->trans = NULL;
 }
 EXPORT_SYMBOL_GPL(virtio_transport_destruct);
 
-- 
2.34.1




More information about the kernel-team mailing list