From patchwork Tue May 26 23:18:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 4978 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:4ec9:b0:861:c897:cb9d with SMTP id i9csp36345mas; Tue, 26 May 2026 16:19:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AFNElJ+qHLfQdLc+izs5/xxW1ba+PER733SCLn8n5QLhN8vmT0vENgq8ulnTyElxZXWUrX2R7C0H7OUUefg=@openvpn.net X-Received: by 2002:a05:6830:6a99:b0:7dc:e08d:d9ec with SMTP id 46e09a7af769-7e5fee9bb80mr14140493a34.15.1779837576895; Tue, 26 May 2026 16:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779837576; cv=none; d=google.com; s=arc-20240605; b=GEsrCpSXIxmKDtMvtc/zvynnwfh2yNCLWnYQbK2Md4/X/KH1GNe6BzkkUow8OR1vol dvLkS7/UflAs9PsgEEqevapaBKEjBy9zmuC+9YckjxuySow1+pWElqXpK7kxbj6EyaPU pKzvZm2JofCgy0loI68OEQNW9T6gDcmtPh+mR+EfTbW7Ct2euBjqLkiDhuAWhYpvmTxf mTK8RguRrFZPFXzr2pZn6UHW5HUP1ldq7jpJOX7WrKTxhW/KqUDr18JNl/tvAxdVzpG7 3MDFChzZfiv9+XzHmREuj0vxnZyBPfffNAVXy1XS9UjhmBss9F2C+hH8FICj507dSeGx dqJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=rUWQF8SNLD3wFAs7D7NWrVe1YnReAFzszAGiE/rgB48=; fh=BsMg/B0Yb/hS/rzP5Npz4luh0IleZm8REk1XWiWRt2A=; b=T3yglP7om6rzfDSTE47udnfD66VU+k8gwJMpnEOnnwk4DVms8g75IG3HHHCCaVZBI3 2EK4TABkriA0f876huaQftVav7UpvXg53ljmNdkK4vDPyE2m/KR/pXF5ubNeq0lC0Q2b ROVbWuYjtBWGsrIjwuD2ToFQ1k83GTFYHNKTJotlYTP/XD00osHmP2kkcWlROAdS5uj/ qnUndiKbqepCnC3yvFK8dQzOo0PWn00K49FBkWQdcTIzOTCtKLbDo598v5RzZuNi7z/q r3hAqmYbaQiuUvxbqU67XH9erXclQFS8bZX1yxHiPUzRWcAyxoqls3uX/ObsJnl4WENo 8EBw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=VeTEe0BT; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HvhZs60F; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eymmkGIP; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=MBO0001 header.b=OtRg6AOp; 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 46e09a7af769-7e6066b0bc1si9481804a34.69.2026.05.26.16.19.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2026 16:19:36 -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=VeTEe0BT; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HvhZs60F; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eymmkGIP; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=MBO0001 header.b=OtRg6AOp; 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=rUWQF8SNLD3wFAs7D7NWrVe1YnReAFzszAGiE/rgB48=; b=VeTEe0BTksIrftzeh3DLTvdLvh yxjA+sxj+mPefYK3E+nhtFFCLo2eYh1BnveFJaWxkDtBBOyQ5P2wBnUUcwx9REs+O5YHqhkRk9CRO FeBJZ3/+o48XkJa48MHht093Phnu+P0IOzAdnQmCuftRBIYpSTlXY8ggoVeYsioYZlvg=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wS13a-0007Kg-81; Tue, 26 May 2026 23:19:30 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wS13X-0007K2-Do for openvpn-devel@lists.sourceforge.net; Tue, 26 May 2026 23:19: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=oUrXqBhmSv6hUIjm7a15fhpW2j0ChPArt7p7zWguUEE=; b=HvhZs60FU17S2c42nQjwaT511x IyLH38ljvMTfP35NcMfNXp7jl/KFayb0zxkccw6ZrBHocz9SBj+uHitEq1GXaNn2T7O3xJwp/wu4H vLdxQDwsE2VoBM7uYB/EnkZchB1P38XswTuBeHxA6DlBshJyMTI3eywn8Un9AI6wrZAE=; 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=oUrXqBhmSv6hUIjm7a15fhpW2j0ChPArt7p7zWguUEE=; b=eymmkGIPiPSA/qKOCkleg5FezI cSFb/k8s72wPnA2xL/u1sAIkOzQfbMtr0EagVptwzpLpxYM9RHSarGnrd+1A9YNVt4m6v+fmdryjz 31QL+DJTUwzfUv0JDxdY7ee0cYqm1gUcjjCvxXmsVDgnAuITcSvSgisEt2uB2Lj1YHi4=; Received: from mout-p-201.mailbox.org ([80.241.56.171]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wS13J-0000UV-A2 for openvpn-devel@lists.sourceforge.net; Tue, 26 May 2026 23:19:15 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.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-201.mailbox.org (Postfix) with ESMTPS id 4gQ7x06trGz9smp; Wed, 27 May 2026 01:19:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unstable.cc; s=MBO0001; t=1779837541; 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=oUrXqBhmSv6hUIjm7a15fhpW2j0ChPArt7p7zWguUEE=; b=OtRg6AOpKkFzWqoW1pQXdCq/aZ/m/Bei2aEOK6PRO1fqIB0KWmfyJ9tDJKOHP+sg3JkPo/ lDOliRBaXLLFKDM6PkDizoRXdYhei4yl8AF9Ga3/agkPIwKgy10n5c9ny5qdiSYWH58PAC OHZ20QtO25AQzMroAwOZ5qMWw9+WOOgdnV67oQir4EpZHVpVFcg/AcVADTxZpjhojD/TtP GFYoBz5/kUxoFnOkCBMaB+i80GR/JmVg8uwbIbdVG2hf/lEijKsqtdaGOKJ6jX1opoEWf5 3ZbLGKpYgdz5D0zYwLtZ9oZpx4TRBcz17flCBccRmlrcH+6rZKejCO0NdFwP6w== From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Wed, 27 May 2026 01:18:50 +0200 Message-ID: <20260526231850.2511369-9-a@unstable.cc> In-Reply-To: <20260526231850.2511369-1-a@unstable.cc> References: <20260526231850.2511369-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.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.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_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1wS13J-0000UV-A2 Subject: [Openvpn-devel] [PATCH ovpn net 9/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: 1866294967176414258 X-GMAIL-MSGID: 1866294967176414258 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 a881510aaac0..0a88ca6bbf97 100644 --- a/drivers/net/ovpn/main.c +++ b/drivers/net/ovpn/main.c @@ -244,8 +244,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; @@ -257,8 +263,6 @@ static int __init ovpn_init(void) goto unreg_rtnl; } - ovpn_tcp_init(); - return 0; unreg_rtnl: