diff options
| author | Ralf Lici <ralf@mandelbit.com> | 2025-10-21 12:09:41 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-29 14:10:20 +0100 |
| commit | d4fa3e039fb47df87066af46c263c0d535aeea56 (patch) | |
| tree | e9233cf05a66bae003100f10915a4de9f97d5723 /net | |
| parent | 89941a0d0fc9561eb62e9d8f185a317d2c44474c (diff) | |
| download | linux-d4fa3e039fb47df87066af46c263c0d535aeea56.tar.gz linux-d4fa3e039fb47df87066af46c263c0d535aeea56.tar.bz2 linux-d4fa3e039fb47df87066af46c263c0d535aeea56.zip | |
espintcp: use datagram_poll_queue for socket readiness
[ Upstream commit 0fc3e32c2c069f541f2724d91f5e98480b640326 ]
espintcp uses a custom queue (ike_queue) to deliver packets to
userspace. The polling logic relies on datagram_poll, which checks
sk_receive_queue, which can lead to false readiness signals when that
queue contains non-userspace packets.
Switch espintcp_poll to use datagram_poll_queue with ike_queue, ensuring
poll only signals readiness when userspace data is actually available.
Fixes: e27cca96cd68 ("xfrm: add espintcp (RFC 8229)")
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20251021100942.195010-3-ralf@mandelbit.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
| -rw-r--r-- | net/xfrm/espintcp.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c index fc7a603b04f1..bf744ac9d5a7 100644 --- a/net/xfrm/espintcp.c +++ b/net/xfrm/espintcp.c @@ -555,14 +555,10 @@ static void espintcp_close(struct sock *sk, long timeout) static __poll_t espintcp_poll(struct file *file, struct socket *sock, poll_table *wait) { - __poll_t mask = datagram_poll(file, sock, wait); struct sock *sk = sock->sk; struct espintcp_ctx *ctx = espintcp_getctx(sk); - if (!skb_queue_empty(&ctx->ike_queue)) - mask |= EPOLLIN | EPOLLRDNORM; - - return mask; + return datagram_poll_queue(file, sock, wait, &ctx->ike_queue); } static void build_protos(struct proto *espintcp_prot, |
