Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@openvpn.net>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Donald Hunter <donald.hunter@gmail.com>,
	Shuah Khan <shuah@kernel.org>,
	ryazanov.s.a@gmail.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	Simon Horman <horms@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Xiao Liang <shaw.leon@gmail.com>,
	steffen.klassert@secunet.com, antony.antony@secunet.com,
	willemdebruijn.kernel@gmail.com, David Ahern <dsahern@kernel.org>,
	Andrew Lunn <andrew@lunn.ch>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH net-next v19 00/26] Introducing OpenVPN Data Channel Offload
Date: Fri, 14 Feb 2025 15:00:31 +0100	[thread overview]
Message-ID: <ccd4c233-e065-456d-8275-ffcca402583d@openvpn.net> (raw)
In-Reply-To: <507c0388-8ce4-47fa-90b3-b46ae170045a@openvpn.net>

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.


  reply	other threads:[~2025-02-14 14:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11  0:39 [PATCH net-next v19 00/26] Introducing OpenVPN Data Channel Offload Antonio Quartulli
2025-02-11  0:39 ` [PATCH net-next v19 01/26] net: introduce OpenVPN Data Channel Offload (ovpn) Antonio Quartulli
2025-02-11  0:39 ` [PATCH net-next v19 02/26] ovpn: add basic netlink support Antonio Quartulli
2025-02-11  0:39 ` [PATCH net-next v19 03/26] ovpn: add basic interface creation/destruction/management routines Antonio Quartulli
2025-02-11  0:39 ` [PATCH net-next v19 04/26] ovpn: keep carrier always on for MP interfaces Antonio Quartulli
2025-02-11  0:39 ` [PATCH net-next v19 05/26] ovpn: introduce the ovpn_peer object Antonio Quartulli
2025-02-11  0:39 ` [PATCH net-next v19 06/26] ovpn: introduce the ovpn_socket object Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 07/26] ovpn: implement basic TX path (UDP) Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 08/26] ovpn: implement basic RX " Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 09/26] ovpn: implement packet processing Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 10/26] ovpn: store tunnel and transport statistics Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 11/26] ipv6: export inet6_stream_ops via EXPORT_SYMBOL_GPL Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 12/26] ovpn: implement TCP transport Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 13/26] skb: implement skb_send_sock_locked_with_flags() Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 14/26] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 15/26] ovpn: implement multi-peer support Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 16/26] ovpn: implement peer lookup logic Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 17/26] ovpn: implement keepalive mechanism Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 18/26] ovpn: add support for updating local UDP endpoint Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 19/26] ovpn: add support for peer floating Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 20/26] ovpn: implement peer add/get/dump/delete via netlink Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 21/26] ovpn: implement key add/get/del/swap " Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 22/26] ovpn: kill key and notify userspace in case of IV exhaustion Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 23/26] ovpn: notify userspace when a peer is deleted Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 24/26] ovpn: add basic ethtool support Antonio Quartulli
2025-02-11  0:40 ` [PATCH net-next v19 25/26] testing/selftests: add test tool and scripts for ovpn module Antonio Quartulli
2025-02-13  0:36   ` kernel test robot
2025-02-14  1:49   ` kernel test robot
2025-02-11  0:40 ` [PATCH net-next v19 26/26] mailmap: remove unwanted entry for Antonio Quartulli Antonio Quartulli
2025-02-12 23:34 ` [PATCH net-next v19 00/26] Introducing OpenVPN Data Channel Offload Sabrina Dubroca
2025-02-13 11:46   ` Antonio Quartulli
2025-02-13 15:46     ` Sabrina Dubroca
2025-02-13 19:40       ` Antonio Quartulli
2025-02-14 13:54         ` Antonio Quartulli
2025-02-14 14:00           ` Antonio Quartulli [this message]
2025-02-13 14:26 ` Sean Anderson
2025-02-13 19:46   ` Antonio Quartulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ccd4c233-e065-456d-8275-ffcca402583d@openvpn.net \
    --to=antonio@openvpn.net \
    --cc=akpm@linux-foundation.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=antony.antony@secunet.com \
    --cc=donald.hunter@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=sd@queasysnail.net \
    --cc=shaw.leon@gmail.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=steffen.klassert@secunet.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox