Re: [PATCH net v2] vsock: Fix memory leak in vmci_transport_recv_dgram_cb()
From: patchwork-bot+netdevbpf
Date: Thu Oct 08 2026 - 14:50:25 EST
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@xxxxxxxxxx>:
On Thu, 8 Oct 2026 14:41:17 +0000 you wrote:
> During the closure of a datagram socket, the vmci_transport_recv_dgram_cb()
> function may be called, which will add the packets
> to the socket's backlog; then, after the receive queue is cleared,
> the __release_sock() function will move the packet back from the socket's
> backlog to the receive queue, which will lead to a memory leak.
>
> sock_close
> __sock_release
> __vsock_release
> // take ownership by user-space
> lock_sock_nested
> sock_set_flag(sk, SOCK_DEAD)
> vmci_transport_release
> vmci_dispatch_dgs
> vmci_datagram_invoke_guest_handler
> vmci_transport_recv_dgram_cb
> sk_receive_skb
> if (!sock_owned_by_user(sk))
> [...]
> (!) else if sk_add_backlog()
> [...]
> (!) skb_queue_purge(&sk->sk_receive_queue)
>
> [...]
Here is the summary with links:
- [net,v2] vsock: Fix memory leak in vmci_transport_recv_dgram_cb()
https://git.kernel.org/netdev/net/c/7c24a4e87e21
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html