From patchwork Wed Jul 29 10:21:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5166 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:fd0b:b0:87d:ab56:3700 with SMTP id cw11csp1746425mac; Wed, 29 Jul 2026 03:22:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+Roemtjl2j54ldrBeHg+eeHrbhTWxVYYneHpLufRjfiZHdBH3G5n3mcupu4rQfz6VglXsEzzJOvWSTI=@openvpn.net X-Received: by 2002:a05:6808:19a2:b0:4a3:5294:43d3 with SMTP id 5614622812f47-4ad5b966694mr3894069b6e.3.1785320545177; Wed, 29 Jul 2026 03:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1785320545; cv=none; d=google.com; s=arc-20260327; b=lGsuvH6yYqpEAGYiFiYIEq1iBPvr0c14ykUx2qghx0mZKcBcY2ZO6LckU/Y03m+s/r 0JPDaD/eplVR1dBHgt+atWWyfu8OrR2n0JfsvmKrZYsyaXMonyWpqbDHN8gQh7JzjPUG IriRrjGBdEsI28vbH+dWhfY4TORSjO7h67vIyy8CFMwDVlkNQ0QW8fg6nTVFsWyj/JUw nlrWBeHkxWP/jzYUzaCtCkX3XDjdU+EIfJOAFRH8yByhzyYaj/GB8luhyHgX7NLWShwn vD0Uh+cnhVTLiri7nyl9u3kK6DlGElSoAh3dLLycU6Jb6y0at/Ch1rbHHEBDYw/07mr5 mrWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding: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=e89kIFnmwRNssbGxBGgtnZI1ArLKDVAoiXXXoiSuFq4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Y2oL9+Kah8VYHTf1Ta+ImTrgWX4Y8EMegCPnmxSwEgTU7Y2moCoEii3gkkjhjHnD/Z RUtQapP/9KqNarPqz87dDYf+rLqPhB9d7T+6JDGQDPuBX6t8Ukh1dmVuoNAmv8LVWnoM 98flpL3LE4ZPJH0T3iU01GV3ZginE9sNn6xKpbqY/1QhElU6ALdZ6Fc1E3ozLXU/YGrB UEmPYkaQrkVInJvR79H4w6aJgDjnS3xau5BSuQJpF8uL/ZSgu4jYONg/tfCxN/qxOUMD /DylsYoE6EIcL5Stp0mIzxRtyLPC9d+LHon+8ouR41L3BfZCJEVdhoERxdgXB2KjRBB8 3DtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=WiqyKvS0; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Xq4sKBC8; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="emncrh/N"; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=G9cWrdJg; 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-4ad6ecab2a4si1321616b6e.26.2026.07.29.03.22.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2026 03:22:25 -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=WiqyKvS0; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Xq4sKBC8; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="emncrh/N"; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=G9cWrdJg; 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: 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:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=e89kIFnmwRNssbGxBGgtnZI1ArLKDVAoiXXXoiSuFq4=; b=WiqyKvS0otuwRGPlgRirUX+kje PUI0k/dAq+mapnu6nkTOrrLr8F+7mF0qPlmLwOnVCT9VH19hEfG0KVBagNJTxgqHS0GJ/Q5pKMEy4 WuKFY1/f+vViS5QSU3Dw3cZfE6cL9MoXWzpjutbsekYR6HbpHk3BhIwSD8rxzKYiyaBA=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wp1Qa-0000Pn-09; Wed, 29 Jul 2026 10:22:20 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wp1QN-0000PC-6E for openvpn-devel@lists.sourceforge.net; Wed, 29 Jul 2026 10:22:07 +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=cVEdZ3i3t9wUqjfdfrCLPyF3EcQBf+QdLVZrCqcZubg=; b=Xq4sKBC8OERBnxWA68nn0XuGQ5 zsFyTmCAQOHBHC3y/M6EFhQ//C3LREbc9CzOUU84j2uco0Xy0VbhbwqN8URyi120krda8t1yZKTUz K9AnNixLyeH/cvWTLyyNlqbNovj9m2W/nwZOyP6kO2yBqjG/AKc28ASaZpJkBGzZW2wE=; 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=cVEdZ3i3t9wUqjfdfrCLPyF3EcQBf+QdLVZrCqcZubg=; b=emncrh/NuDge0AV7hLSytyVGQx P2TByKyAq0FQMlkC5V2e+knhJa2w35FxN/QB6cqQWRwl1zFcpY7F1TYeekOMS+i3F4k+njMJ12hQZ hdw62Jb9vi3n4ViB8/ZYdMt0cA40W4rUGENdGPLQbpjCvP3003C9FQO5jDmwHgPsaFxQ=; Received: from mout-b-105.mailbox.org ([195.10.208.50]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wp1QM-0003Uc-4v for openvpn-devel@lists.sourceforge.net; Wed, 29 Jul 2026 10:22:07 +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-b-105.mailbox.org (Postfix) with ESMTPS id 4h97fs5Yc4z9smZ; Wed, 29 Jul 2026 12:21:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1785320517; 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=cVEdZ3i3t9wUqjfdfrCLPyF3EcQBf+QdLVZrCqcZubg=; b=G9cWrdJg84cU6ROy0emz2fUmeZbkRmkkzWPIOe462T4X3zOZhlPQ3UEgrYFxA1A1uVPZS+ PIsWBPNr+I5oNmYOe6R8jocIwy/C2dTdc2GUaANHDPpRKbipij36h7C43S/gRuALCamAr3 wCM9hAk4FjNp5pjQJubM2pGakNjerer5smVWYGHa64O8p9EOsqkdhmkJM4sk3j7mGGvdWI Y2XQ1wd8HErwMepRVsBRKVB7vIOqXNWxfiF/jiZpjtP/ZjZk/wdhD4b2qYEjRiq6TjAa7b oPSVqXWqJUzvtFRM67sSGu3DS8if4bvyCcDWOWUn/d+5PyHEMeNdqMpjRSazXA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=ralf@mandelbit.com From: Ralf Lici To: openvpn-devel@lists.sourceforge.net Date: Wed, 29 Jul 2026 12:21:43 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4h97fs5Yc4z9smZ 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: ovpn_tcp_init initializes the TCP proto and proto_ops templates used when a TCP socket is attached to an ovpn peer, but ovpn_init registers the generic netlink family before initializing those templat [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.10.208.50 listed in wl.mailspike.net] X-Headers-End: 1wp1QM-0003Uc-4v Subject: [Openvpn-devel] [PATCH ovpn net v6 3/6] ovpn: initialize TCP state before registering UAPI 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1872044275660955051 X-GMAIL-MSGID: 1872044275660955051 ovpn_tcp_init initializes the TCP proto and proto_ops templates used when a TCP socket is attached to an ovpn peer, but ovpn_init registers the generic netlink family before initializing those templates. Once the family is visible, userspace can create an ovpn device and configure a TCP socket while the TCP templates are still zero-initialized. Initialize the TCP templates before publishing the netlink interfaces, so externally reachable setup paths can only observe initialized TCP state. Fixes: 11851cbd60ea ("ovpn: implement TCP transport") Signed-off-by: Ralf Lici --- Changes since v5 https://lore.kernel.org/openvpn-devel/8f7261c5719fd67b8f0da4d0e89f2c4517fa8168.1783336121.git.ralf@mandelbit.com/ - Reword the message and drop the extra comment in the code (Sabrina). New patch added in v5. drivers/net/ovpn/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c index 9993c1dfe471..5093a3b5aba6 100644 --- a/drivers/net/ovpn/main.c +++ b/drivers/net/ovpn/main.c @@ -233,8 +233,11 @@ static struct rtnl_link_ops ovpn_link_ops = { static int __init ovpn_init(void) { - int err = rtnl_link_register(&ovpn_link_ops); + int err; + 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; @@ -246,8 +249,6 @@ static int __init ovpn_init(void) goto unreg_rtnl; } - ovpn_tcp_init(); - return 0; unreg_rtnl: