From patchwork Mon Apr 27 04:00:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qingfang Deng X-Patchwork-Id: 4910 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:66c6:b0:84a:48f:a1fd with SMTP id x6csp5813994mal; Sun, 26 Apr 2026 21:00:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AFNElJ9JPzMOFGgXhVb5t0/A1pTbY5W3XP/KCk5DYmomLC355JT2q/bgNrkarsA6yKEIHmmoKev4+810SJ4=@openvpn.net X-Received: by 2002:a05:6870:8904:b0:424:684:c423 with SMTP id 586e51a60fabf-42adecf70c2mr25289895fac.18.1777262458744; Sun, 26 Apr 2026 21:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777262458; cv=none; d=google.com; s=arc-20240605; b=EIHV+4h3ILZRG5lU05COUjzmusE3wJKDMH5gkycC4tsnH8+ehRu9mlYxpKpjX1c/Oq m1VgaM4SMxdKCyb8c1/5TsCiUOXUCRurIKKoX8BP7kdDILNf44XTe5fS253MALP6csPc nun9pOQJ1H61GyNLjgWP1+XKylbAEr5p363EVBSO1Z0zhxRRmuKpceysbr5n1u7/N2JY FWRgZJmMDT2ZQuuKzli3OOJdA41aS+KfJNNvoeqfDsNc/h3ecw1z41y1QD9aXW+D8Wyl NyesQIX6Fij6exINnYBJM5uUGD/7WRhWnatHzkQaonLzFXm8c1UIlg2dzQKF9y6NG13n X4ng== 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:message-id:date:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=A05Ey8IpUkuSCvdbLuAdkRc9aTgPii6aBDdT+Fkb3hc=; fh=RmwTj8S33py+YlhbuOtLpfmQvEPg1/Bo4P1ZwxfeBY8=; b=OBDROlBpDLCjhAGLVdljDaNgKKWcCbbvzDipejnq9Fw8klS/IHrx6BnBA9SBbGa1FG 1zuqAsqn1hoxhpyxqW7v0xgvyodSdLLwz98tgwUQY3OCDhOrU2FekVOy5fnHPiLLQQLr Z0SF5OUSoZA5bmNyZ3GRYjXuO6zTnzquIRJiGQMAhHtAHimRfzL+XgO2GLS/ca9PE5i2 +MIIrzKU7FGtfYjMDMKk5lKH/LKwujgrg4+kUvKFsH68a3fKZFiy2pj37kRuK3qfNSoA gVC5RJROu0tcGHLRh2yh7V6ap+878UTP7eWqbJ0UAVx3TUgPJE49RPD/yjZ7UOmBqVru MGKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=XOkq1CJx; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=b1t6RIQl; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aP4dAfiS; dkim=neutral (body hash did not verify) header.i=@linux.dev header.s=key1 header.b=jjkv5EaX; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-4302b664043si3721884fac.208.2026.04.26.21.00.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Apr 2026 21:00:58 -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=XOkq1CJx; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=b1t6RIQl; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aP4dAfiS; dkim=neutral (body hash did not verify) header.i=@linux.dev header.s=key1 header.b=jjkv5EaX; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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: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:In-Reply-To:References:List-Owner; bh=A05Ey8IpUkuSCvdbLuAdkRc9aTgPii6aBDdT+Fkb3hc=; b=XOkq1CJxj+Y3H3XZzycoy7iSAh lbiPVI/UbHsv/WR3E5lJCPykqoPgAQbANAQtABuK/1MtMlnZGB+l7oyK8EXRrGz3y9ZIkU7E7MTGt f018XKU7xi/1Dv1OJYL94eRBLkCuB9Yw12OoMHAoyPjWvdCN5wE+qtkrrGvGW5yoGd/4=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wHD9H-0008Pp-I2; Mon, 27 Apr 2026 04:00:43 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wHD9G-0008Pj-GA for openvpn-devel@lists.sourceforge.net; Mon, 27 Apr 2026 04:00:42 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9EOQitU35OutH5JCPZkrXHyY7o/rqe7RYiKWeclzr6M=; b=b1t6RIQloGhXlR1d3l1cGd20R6 W2c9zWfiuiLNFzQnaCTEJXOWHLmk+QUrCDzAZzGHtRX113m3X68UPjHR98uUfoBndFPUfwQK68jKV lDtJ5QUu8Hn5booLzToBh5tc7jT5gUVDQUGURaCaqfRTcRk0Kb9zn4qBeV0ErNAOXx04=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=9EOQitU35OutH5JCPZkrXHyY7o/rqe7RYiKWeclzr6M=; b=a P4dAfiSIDyNV0oCAcAKKVjJnOL/Nqetu4VG11MBVOjqUdtZuqLhVFUh6DV3FEP2erwM3Rrf4SrJIH oXoZLB+BHliBsLVY79qjt+64vjYaZy3N9qSteKqSTD72utteVEfAN7SiT6qZowAi5/RHxp0DUu/tC tMz6U3mGhUs+KOdE=; Received: from out-187.mta1.migadu.com ([95.215.58.187]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wHD9F-0007fP-FA for openvpn-devel@lists.sourceforge.net; Mon, 27 Apr 2026 04:00:42 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1777262430; 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; bh=9EOQitU35OutH5JCPZkrXHyY7o/rqe7RYiKWeclzr6M=; b=jjkv5EaXryfFo/460oYqrFMrcritRqtAhaWcv4Qd5N10E0PMK+fUjDP7ofU//gjosJgcwE 9w1rwBjnCIwbsAGkc0nicczTuh56d2v65D6o4Au5YRpFmkf4hKKE/HQx/5eMNp02DoDM9V GYQMk+upnUFXP+yMfASr3pVmOMAarC8= From: Qingfang Deng To: openvpn-devel@lists.sourceforge.net Date: Mon, 27 Apr 2026 12:00:11 +0800 Message-ID: <20260427040011.2107748-1-qingfang.deng@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT 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: After decapsulating a packet, the skb->mac_header still points to the outer transport header. Call skb_reset_mac_header() in ovpn_netdev_write() to ensure the MAC header points to the beginning of the [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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.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: 1wHD9F-0007fP-FA Subject: [Openvpn-devel] [PATCH ovpn-net-next] ovpn: reset MAC header before passing skb up 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 , Minqiang Chen Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1863594759785975893?= X-GMAIL-MSGID: =?utf-8?q?1863594759785975893?= After decapsulating a packet, the skb->mac_header still points to the outer transport header. Call skb_reset_mac_header() in ovpn_netdev_write() to ensure the MAC header points to the beginning of the inner IP packet. Reported-by: Minqiang Chen Fixes: 8534731dbf2d ("ovpn: implement packet processing") Signed-off-by: Qingfang Deng --- drivers/net/ovpn/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c index db43a1f8a07a..d92bb87be2b2 100644 --- a/drivers/net/ovpn/io.c +++ b/drivers/net/ovpn/io.c @@ -85,6 +85,7 @@ static void ovpn_netdev_write(struct ovpn_peer *peer, struct sk_buff *skb) skb_scrub_packet(skb, true); /* network header reset in ovpn_decrypt_post() */ + skb_reset_mac_header(skb); skb_reset_transport_header(skb); skb_reset_inner_headers(skb);