On Tue, 2025-10-14 at 17:01 +0200, Sabrina Dubroca wrote:
> This would clear EPOLLIN and EPOLLRDNORM if they were set (alongside
> EPOLLRDHUP) because the socket was shutdown():
> 
> //
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/tree/net/core/datagram.c?h=v6.17#n952
>       shutdown = READ_ONCE(sk->sk_shutdown);
>       if (shutdown & RCV_SHUTDOWN)
>               mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
> 
> which may not be desireable?
> 
> 
> Maybe another way to deal with it would be to add a variant of
> datagram_poll that takes the "real" RX queue as extra argument, and
> make datagram_poll a wrapper (using sk_receive_queue) around it. Then
> ovpn could use this new __datagram_poll helper with tcp.user_queue

I totally agree.

> (but I'm not sure we can call datagram_poll under rcu_read_lock).

I see the problem may arise from the call to sock_poll_wait, which isn't
safe inside an rcu_read_lock() section. Perhaps the __datagram_poll
helper could delegate the responsibility of calling sock_poll_wait to
the caller, allowing it to perform the rest of the polling logic safely
within the RCU read-side critical section.

> 
-- 
Ralf Lici
Mandelbit Srl


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to