From patchwork Tue Jul 28 11:48:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 5144 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:fd0b:b0:87d:ab56:3700 with SMTP id cw11csp485524mac; Tue, 28 Jul 2026 04:49:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+Rpk43CJ4LC/IzJVTsuvga4QljEVtRRCSh7Y5PCDDygV2/JcgZeb12JEZh4UjZPzQS9/myGJKNmvMEI=@openvpn.net X-Received: by 2002:a05:6808:228e:b0:497:8b9:bdc7 with SMTP id 5614622812f47-4ad5b9ca9e3mr1305254b6e.15.1785239358932; Tue, 28 Jul 2026 04:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1785239358; cv=none; d=google.com; s=arc-20260327; b=MaMZel6c3Km7XGohZSmacEJU+C3t0qeEn7Dl9j6C9mZkg2UT2bHJHye9jk+u3hXSgZ dpn3mHnDVxcNGNwHHp6aOyxBI6iWgmi66BUi5mMHYQhH8NM3GJz4vGECSP+4eC3bubxz Aabq5lbsdEWU9YKphEpYaFV7bksIWhPtoeIM/b0rIyjpQVrYgVMdjpxsXDZxNY1UP8AR LvmPb3b2RlCG4dV82KVCZ+l2L4jnazT4HZvvgVDRaOVIJZeT61Sp1vGdO69wMMb55bhJ ROhsuLrPDvuRuyVqmmJrHB3DV0hS+yzSns4vmsoNsvD87EntJz0bIJau/21Iaxcb92St ju2w== 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=K7uPa0Q1mQpiugwmXPpWRDz2b8XlNNd76W/WhCxarpcumlmJQe4thUqB+arjhfLx9e BrAPrT+s01H7hLRFXB/mLUQ98g/Dkm5WZQfmuTEBswRqUr+KoKLE+giDLnvBudKbIqrU WJZzxjGzGZ/mItrARjI3ovXSUQyHXHCYQjHVphK2wIB+Y7xFlG/h7XxDJCFsHefuvkgJ rgLb2Vk98m3/JZmexhHCXKalU+g2XoFL4n4cj5MI1IvvwLvc1ZDMbbA/wspAQ3JwI0aQ wAc3yLmle8RfSclAEeWwuII+FVpANfysEgaPPy2gRysX1k0KYvSF1PKbe9shLygec9Gi +ORQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=CYTi3rBu; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Iwtaj1ej; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="B5W/Xr43"; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=MBO0001 header.b=C+d8hzx2; 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 5614622812f47-4ab4b3faac3si10618183b6e.66.2026.07.28.04.49.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2026 04:49:18 -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=CYTi3rBu; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Iwtaj1ej; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="B5W/Xr43"; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=MBO0001 header.b=C+d8hzx2; 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=CYTi3rBuXu/0pK2FTQYA2uYif7 lrKg6tukfXvfWUEKqykqYtlzv8I6jR2dQYhhgTUAC1sDNik9vZtBIrjre71sNlXt0snOdFAhLCo5m lVsu3l/nJVsnRLi3BeqgVvw3QGVoUX6uf8+XEark5yh5LJhq2FWKYHHnqZJVhFUdgjCM=; 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 1wogJC-0005td-C9; Tue, 28 Jul 2026 11:49:15 +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 1wogJA-0005tQ-LV for openvpn-devel@lists.sourceforge.net; Tue, 28 Jul 2026 11:49:14 +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=Iwtaj1ej5ZXhMy6nmNfwp2qPii zpL5w4YVPCncQNri3IU2pj8KglZSr589sMFwmXTBhji0QQPBC5pNzO/eqtueML3Q9bfGJCe6SEiYb /KQN7g7qmvOU/mRfUq3yVKyG5miBlVsTOkjWcuHm3oPQmskO0zmjAVjYNe7mdDaCXOr4=; 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=B5W/Xr433YQK+UdKEHA4CFmmmm VdtkGGsKlchaPJYl4BtWesgVmO4nTfJVT42qwy4Kjzk8SwetHNZT3Fn5ZvKoEcc4yBvOqATQs29Oe Pg7Kmvc6+OyKlx3QTtuo+H0GnDH3N3LLJN72ybJAAnFU4pqbWBTC3JSjYeaZZ/TZAkIA=; 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 1wogJ7-0002v1-Jj for openvpn-devel@lists.sourceforge.net; Tue, 28 Jul 2026 11:49:14 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (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 4h8Yds6wRwzMlK5; Tue, 28 Jul 2026 13:49:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unstable.cc; s=MBO0001; t=1785239345; 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=C+d8hzx2amUKvJC+3mCNuzpbl81zptRIlteIlerx011raepKGqYsPsZJhaoHymh15aeXRv KywapRm4PVW/LHiEqU3ompG9qQkxIEAxn9zEgK8b0KCgvjJLXKWNQwEGyo0+lBRp5GkS1N YQKYu5J7RsaN6HMk6AlKLfi0sYS6ywL0JMMYI34wJwbYoVrkZ9GW8nkdsF3aq3VzrcNvlX xKGTOJfOVjM0nzzK0GU2Q8F6aatqHMHBUTAIRusT2j5+9Lp2W/6XrpVVG1MpSmliupkJ1E 8FFAOKCWvJhZ/Y9O4jY3PdeJLLpgpVLxBv4d1fLuZn6b9r2S7DzQYmeW1qBy6Q== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of a@unstable.cc designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=a@unstable.cc From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Tue, 28 Jul 2026 13:48:54 +0200 Message-ID: <20260728114855.1323861-9-a@unstable.cc> In-Reply-To: <20260728114855.1323861-1-a@unstable.cc> References: <20260728114855.1323861-1-a@unstable.cc> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4h8Yds6wRwzMlK5 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.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [80.241.56.172 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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 Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1wogJ7-0002v1-Jj Subject: [Openvpn-devel] [PATCH ovpn net v4 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: 1871959145681427795 X-GMAIL-MSGID: 1871959145681427795 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: