From 5b9223a56fd64f0d2ac9c67ab7818c72e25ebf55 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 29 Nov 2023 13:00:11 +0000 Subject: [PATCH] Revert "virtio/vsock: don't drop skbuff on copy failure" This reverts commit 1e5f00e9dbdbf6f78adc0fe658b6ac54df71d452 which is commit 8daaf39f7f6ef53a11817f6a11ec104016c3545f 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: Ie929bb2fbb4e3dc3cadc1e0d3b63ed8e83257a4a Signed-off-by: Greg Kroah-Hartman --- net/vmw_vsock/virtio_transport_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index da1de9dae856..7f26869de762 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -368,7 +368,7 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk, spin_lock_bh(&vvs->rx_lock); while (total < len && !skb_queue_empty(&vvs->rx_queue)) { - skb = skb_peek(&vvs->rx_queue); + skb = __skb_dequeue(&vvs->rx_queue); bytes = len - total; if (bytes > skb->len) @@ -392,8 +392,9 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk, u32 pkt_len = le32_to_cpu(virtio_vsock_hdr(skb)->len); virtio_transport_dec_rx_pkt(vvs, pkt_len); - __skb_unlink(skb, &vvs->rx_queue); consume_skb(skb); + } else { + __skb_queue_head(&vvs->rx_queue, skb); } }