]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf, vsock: Invoke proto::close on close()
authorMichal Luczaj <mhal@rbox.co>
Mon, 18 Nov 2024 21:03:43 +0000 (22:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:14 +0000 (20:03 +0100)
commita222e48feaf119de6d83ddc9109538796dee4ea3
tree8e385f66243481513474ab7b56a3aa6078c353ad
parent47f4ad956be07abeba10fb23c196977900aba064
bpf, vsock: Invoke proto::close on close()

[ Upstream commit 135ffc7becc82cfb84936ae133da7969220b43b2 ]

vsock defines a BPF callback to be invoked when close() is called. However,
this callback is never actually executed. As a result, a closed vsock
socket is not automatically removed from the sockmap/sockhash.

Introduce a dummy vsock_close() and make vsock_release() call proto::close.

Note: changes in __vsock_release() look messy, but it's only due to indent
level reduction and variables xmas tree reorder.

Fixes: 634f1a7110b4 ("vsock: support sockmap")
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Link: https://lore.kernel.org/r/20241118-vsock-bpf-poll-close-v1-3-f1b9669cacdc@rbox.co
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/vmw_vsock/af_vsock.c