From patchwork Mon Jul 27 20:07:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 5137 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:190f:b0:87d:a69c:34be with SMTP id g15csp1598710maz; Mon, 27 Jul 2026 13:07:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RqtdSWJRZ8AD252Uck3HeCuEH8qi8MH/Olt7F4dpnlJI3vtFxM+aCxSvKx+Oe8JFWglWQ50fX5tZ0Y=@openvpn.net X-Received: by 2002:a4a:ee10:0:b0:6aa:9be1:484a with SMTP id 006d021491bc7-6ac90bbdb31mr889088eaf.7.1785182854379; Mon, 27 Jul 2026 13:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1785182854; cv=none; d=google.com; s=arc-20260327; b=Gj2kcXJc63nvS2fSYNJqIRS4090LJqVJK2Q0JmMOWuEgEyA+WLS4reicS46RinM8J2 3JlIna6URGVbHUDrv4u+oZJvFXfxCQnbnNrbFiOVhPss0vlLP6oBIL5VBs5A92Jdr8c3 yHCBtfgU+mWX6fFln9zZz+xAtxgWp/TN3FOd5ifhBha3c+ycheIkBllfD5dWgNJmZ4Yt z9S49sJ6HR77nVlMIr+fXrAWcVsLmqx0lUGOX05X7MWMPcE9fQKChNCo2K35fWZxVvuD AvqNxvyyzPdf1NG561sYcQGYNxLPNlHwn6gqtBf/qIfCFomdM7UOqDHD467RVJSTp3dS klmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=MwQgd9got00wHlhrV53CT4w4al0uuUpnTo79rg8BRDw=; fh=BsMg/B0Yb/hS/rzP5Npz4luh0IleZm8REk1XWiWRt2A=; b=Nx/WPfC0efItRhaxSOIdwEW2ir5i8BbDlFc8uipkXU1H9ya3AWBw1ixtgr06+wNkeT uk8hF7vsdfb18dEYc62QOCnGMgxb7AkbRvJldVvRQjqMmLfTqoqIlfSHgVrjabID5XZG fQLE9j6S/ghu5371SgHZjc5nu1gM1xzyi5H4dGnLwOX2idsqwwOOBG40n6Jx7MOnEQFn +7UwvmR5/WtcD7FFKiqwDLNlocfycbKR6Wz8OZ9zKzTgnEpxRFnZvCCESKYVgs+wOmbd eDmfFoOH8sUCc6u8vApTo1JqJyPPCZCEehh6p3B8TQZVg6zDUF8grxagngab2LgkPGS7 PkaQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=ZPPRxsyf; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="gzR4m/0K"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=k+xRhFph; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=MBO0001 header.b=kGEsLO6q; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 006d021491bc7-6aaf91684c1si6485846eaf.0.2026.07.27.13.07.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2026 13:07:34 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=ZPPRxsyf; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="gzR4m/0K"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=k+xRhFph; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=MBO0001 header.b=kGEsLO6q; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MwQgd9got00wHlhrV53CT4w4al0uuUpnTo79rg8BRDw=; b=ZPPRxsyfD+3vNg8+Zix8Yi/R9P FowRsnAmCKAs5EaP81JbjBpq/q/5ME6B9gHKD9ssErjKQEiOEMCAJeocMel2g0NRu0X0Y4SG8sluB 8b+bUK7n3NYpyKjHD7LInq9y9jvNtDc6hqAnUlcbV4QGWikbU8UyowmYUGMMRgPFeAXc=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1woRbp-0008ME-MZ; Mon, 27 Jul 2026 20:07:31 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1woRbl-0008Lm-Iz for openvpn-devel@lists.sourceforge.net; Mon, 27 Jul 2026 20:07:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=j4K0CryDDnvcfv4cinY40LKzzK/Yzm1HDYN5nMvZdnA=; b=gzR4m/0KiiK92eCv3hWQJecbv9 huu4gBo9FWPyXkP5dcg8psIlOCSBixS7BSS8ZMAlRVDPvt956FM9qul2c5bGxN0U3Nx8wukY3I0Dc IMQ4JfILgNeHB3yGKQkeJaiFkiroxxbseK86gHW0b7SJ3EcbTyzBNQUzWw2zUGqF3aiY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=j4K0CryDDnvcfv4cinY40LKzzK/Yzm1HDYN5nMvZdnA=; b=k+xRhFpheFdQRbK7fYEWTv5yTC FGLrVYrHYZXwjH0ynogr6OpHXFPcI72LFl2eeILIaHr1x26nCa9Rq3AlfljPzZTFk0gTP6FkumBV+ XWVY4DbUPmBSBaMiMqxnGw0RX/meHNI22zqMz9R67VtKtHEu747bIkHcp541YSbiqp/4=; Received: from mout-p-202.mailbox.org ([80.241.56.172]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1woRbh-0001PN-KQ for openvpn-devel@lists.sourceforge.net; Mon, 27 Jul 2026 20:07:27 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4h88l95vs4zMlP0; Mon, 27 Jul 2026 22:07:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unstable.cc; s=MBO0001; t=1785182837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j4K0CryDDnvcfv4cinY40LKzzK/Yzm1HDYN5nMvZdnA=; b=kGEsLO6qDCoasEG/prSuCCPap8MvDAZWCG8wjELyW1qwuwhcNeob0fUdEyXy1fNYmDIxFe 5J8iHkDb12Lxhx6biM0rZmzyqO2kPTad/X/RHeYhFSAn63vZPQQxoqqh9R6EpIX+JRqrgF m6jcNhn05xpc33MgmXAUiirB3y69NRqpemh4Mf9ub6vtA6KhP1DUvZxoahLySQ8e/QY9w8 iYZJAfe90z6C5MN97SgbKEjWZqsWcBSK60uyyBJE2nenJV5NJ8GUc8DFMpb0Yhbmf4UPUL 5HUfFgs8bBOJH4fcr35mC9eiJn0+x7804Vo9uVGuqueFuAqt49RN+dUenAcepA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of a@unstable.cc designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=a@unstable.cc From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Mon, 27 Jul 2026 22:07:04 +0200 Message-ID: <20260727200705.869169-9-a@unstable.cc> In-Reply-To: <20260727200705.869169-1-a@unstable.cc> References: <20260727200705.869169-1-a@unstable.cc> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4h88l95vs4zMlP0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Antonio Quartulli Netlink calls may access TCP global vars (i.e. when attaching a TCP socket), therefore we need to make sure the latters are initialized beforehand. For this reason move the global TCP initialization at the top of the module init function. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [80.241.56.172 listed in wl.mailspike.net] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1woRbh-0001PN-KQ Subject: [Openvpn-devel] [PATCH ovpn net v3 8/9] ovpn: ensure TCP vars are initialized first X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1871899896915577587 X-GMAIL-MSGID: 1871899896915577587 From: Antonio Quartulli Netlink calls may access TCP global vars (i.e. when attaching a TCP socket), therefore we need to make sure the latters are initialized beforehand. For this reason move the global TCP initialization at the top of the module init function. Fixes: 11851cbd60ea ("ovpn: implement TCP transport") Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c index c4e775250727..f8ae64612951 100644 --- a/drivers/net/ovpn/main.c +++ b/drivers/net/ovpn/main.c @@ -253,8 +253,14 @@ static struct rtnl_link_ops ovpn_link_ops = { static int __init ovpn_init(void) { - int err = rtnl_link_register(&ovpn_link_ops); + int err; + /* init TCP first so that any subsequent netlink operation + * is ensured to access initialized TCP global vars + */ + ovpn_tcp_init(); + + err = rtnl_link_register(&ovpn_link_ops); if (err) { pr_err("ovpn: can't register rtnl link ops: %d\n", err); return err; @@ -266,8 +272,6 @@ static int __init ovpn_init(void) goto unreg_rtnl; } - ovpn_tcp_init(); - return 0; unreg_rtnl: