diff options
author | Michal Luczaj <mhal@rbox.co> | 2024-11-18 22:03:41 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-11-25 23:19:14 +0100 |
commit | 9f0fc98145218ff8f50d8cfa3b393785056c53e1 (patch) | |
tree | affb90b1c8e3cac429693f230b9ebec1695734e8 /net/vmw_vsock | |
parent | bpf, lsm: Remove getlsmprop hooks BTF IDs (diff) | |
download | linux-9f0fc98145218ff8f50d8cfa3b393785056c53e1.tar.xz linux-9f0fc98145218ff8f50d8cfa3b393785056c53e1.zip |
bpf, vsock: Fix poll() missing a queue
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>
Diffstat (limited to 'net/vmw_vsock')
-rw-r--r-- | net/vmw_vsock/af_vsock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 25b28b1434f5..725da7203f2d 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -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 |