From ec573670da76aecf0b256ae8a82c016010b5ed06 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 29 Nov 2023 13:00:09 +0000 Subject: [PATCH] Revert "virtio/vsock: fix leaks due to missing skb owner" This reverts commit a6650e78c428841da5d68904475c5d177f3d11ee which is commit f9d2b1e146e0f82f3d04629afd92698522058361 upstream. It needs to be reverted, as the function virtio_transport_free_pkt() is in the stable Android ABI, and this function is removed in the 6.1.63 kernel as part of a series of fixes and optimizations of the virtio networking connection. To preserve the ABI (and thereby keeping the slower interface), revert the commit for now. If this needs to come back in the future, if performance for this interface needs to be resolved, it can be done so in an ABI-safe way. Bug: 161946584 Change-Id: Ia3ece70e6ced0b779c911cb47aa133c2d378aa82 Signed-off-by: Greg Kroah-Hartman --- net/vmw_vsock/virtio_transport_common.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index a3e804b2057d..da1de9dae856 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -98,11 +98,6 @@ virtio_transport_alloc_skb(struct virtio_vsock_pkt_info *info, info->op, info->flags); - if (info->vsk && !skb_set_owner_sk_safe(skb, sk_vsock(info->vsk))) { - WARN_ONCE(1, "failed to allocate skb on vsock socket with sk_refcnt == 0\n"); - goto out; - } - return skb; out: @@ -1311,11 +1306,6 @@ void virtio_transport_recv_pkt(struct virtio_transport *t, goto free_pkt; } - if (!skb_set_owner_sk_safe(skb, sk)) { - WARN_ONCE(1, "receiving vsock socket has sk_refcnt == 0\n"); - goto free_pkt; - } - vsk = vsock_sk(sk); lock_sock(sk);