Thread (37 messages) 37 messages, 4 authors, 2025-02-14

Re: [PATCH net-next v19 00/26] Introducing OpenVPN Data Channel Offload

flat view

From: Antonio Quartulli <antonio@openvpn.net>
Date: 2025-02-14 14:00:34
Also in: linux-kselftest, lkml

On 14/02/2025 14:54, Antonio Quartulli wrote:
For example in wireguard/device.c the socket is released in pernet_operations.pre_exit().

But pre_exit() is invoked in cleanup_net(), which is invoked ONLY if the net refcount has reached 0...but how can it be zero before the sockets have been released?

I must be missing something, because this seems to be a reference loop.
FTR, the answer is that sockets created in-kernel (like for wireguard) have sk->sk_ref_cnt set to 0, which implies that no reference to the netns is taken.

So ovpn has this issue because our sockets are coming from userspace.

Regards,

-- 
Antonio Quartulli
OpenVPN Inc.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help