Skip to content
Commit a6650e78 authored by Bobby Eshleman's avatar Bobby Eshleman Committed by Greg Kroah-Hartman
Browse files

virtio/vsock: fix leaks due to missing skb owner

commit f9d2b1e1 upstream.

This patch sets the skb owner in the recv and send path for virtio.

For the send path, this solves the leak caused when
virtio_transport_purge_skbs() finds skb->sk is always NULL and therefore
never matches it with the current socket. Setting the owner upon
allocation fixes this.

For the recv path, this ensures correctness of accounting and also
correct transfer of ownership in vsock_loopback (when skbs are sent from
one socket and received by another).

Fixes: 71dc9ec9

 ("virtio/vsock: replace virtio_vsock_pkt with sk_buff")
Signed-off-by: default avatarBobby Eshleman <bobby.eshleman@bytedance.com>
Reported-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Link: https://lore.kernel.org/all/ZCCbATwov4U+GBUv@pop-os.localdomain/
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bb1c9a59
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment