]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bpf, vsock: Fix poll() missing a queue
authorMichal Luczaj <mhal@rbox.co>
Mon, 18 Nov 2024 21:03:41 +0000 (22:03 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 25 Nov 2024 22:19:14 +0000 (14:19 -0800)
When a verdict program simply passes a packet without redirection, sk_msg
is enqueued on sk_psock::ingress_msg. Add a missing check to poll().

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-1-f1b9669cacdc@rbox.co
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
net/vmw_vsock/af_vsock.c

index 25b28b1434f5eacfd132127fd4b7fdcefcb4042e..725da7203f2de64fa385761eb30db8223a061b12 100644 (file)
@@ -1054,6 +1054,9 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
                mask |= EPOLLRDHUP;
        }
 
+       if (sk_is_readable(sk))
+               mask |= EPOLLIN | EPOLLRDNORM;
+
        if (sock->type == SOCK_DGRAM) {
                /* For datagram sockets we can read if there is something in
                 * the queue and write as long as the socket isn't shutdown for