Commit 3f08b79a authored by Michal Luczaj's avatar Michal Luczaj Committed by Lee Jones
Browse files

UPSTREAM: bpf, vsock: Invoke proto::close on close()



commit 135ffc7b upstream.

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.

Bug: 396331793
Fixes: 634f1a71 ("vsock: support sockmap")
Signed-off-by: default avatarMichal Luczaj <mhal@rbox.co>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: default avatarLuigi Leonardi <leonardi@redhat.com>
Link: https://lore.kernel.org/r/20241118-vsock-bpf-poll-close-v1-3-f1b9669cacdc@rbox.co


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
[LL: There is no sockmap support for this kernel version. This patch has
been backported because it helps reduce conflicts on future backports]
Signed-off-by: default avatarLuigi Leonardi <leonardi@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 13a4362a)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I8aefa411aa1ef317743deb600aaa4a9cdd52abd3
parent ff074b27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment