Article View: linux.kernel.netdev
Article #25245[PATCH 14/22] xfrm: espintcp: select receive path by skb protocol
From: Steffen Klassert
Date: Tue, 01 Dec 2026 12:41
Date: Tue, 01 Dec 2026 12:41
34 lines
10296 bytes
10296 bytes
From: Zihan Xi <zihanx@nebusec.ai>
An IPv6 socket can accept an IPv4 connection through a v4-mapped
address. Such a socket still receives IPv4 skbs, but espintcp selected
the XFRM receive path from the socket family.
Use the skb protocol when selecting the receive path so IPv4 packets are
not passed to the IPv6 XFRM parser.
Fixes: 26333c37fc28 ("xfrm: add IPv6 support for espintcp")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/espintcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c
index 3e23900d6446..8412dc8eeed7 100644
--- a/net/xfrm/espintcp.c
+++ b/net/xfrm/espintcp.c
@@ -48,7 +48,7 @@ static void handle_esp(struct sk_buff *skb, struct sock *sk)
}
local_bh_disable();
#if IS_ENABLED(CONFIG_IPV6)
- if (sk->sk_family == AF_INET6)
+ if (skb->protocol == htons(ETH_P_IPV6))
xfrm6_rcv_encap(skb, IPPROTO_ESP, 0, TCP_ENCAP_ESPINTCP);
else
#endif
--
2.53.0
Technical Details
Message-ID:
<20261201124252.1163254-15-steffen.klassert@secunet.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375036-linux-kernel-netdev=dewy.ruReferences:
<20261201124252.1163254-1-steffen.klassert@secunet.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375036-linux-kernel-netdev=dewy.ru From: steffen.klassert@secunet.com (Steffen Klassert) Newsgroups: linux.kernel.netdev Subject: [PATCH 14/22] xfrm: espintcp: select receive path by skb protocol Date: Tue, 1 Dec 2026 13:41:40 +0100 Organization: Usenet Network Message-ID: <20261201124252.1163254-15-steffen.klassert@secunet.com> References: <20261201124252.1163254-1-steffen.klassert@secunet.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1711519"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7cnn8tqJhUF4eHf7VMBQeFJpfgg= sha256:6Ywexqo3WGRL0MInpHkuUmHc8bTnmP4Yx2GhhP1lX40= sha1:BuNLLdVXyFOPfTKCh5CkuliR7LM= sha256:Z5OtsIC0ysbgyz8mXrxWqfxd17fGABcExOl3IDYSAhA= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id C232011738A; Tue, 1 Dec 2026 15:44:23 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=secunet.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cz1Fl7L-kNGa; Tue, 1 Dec 2026 15:44:21 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375036-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=secunet.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id C822A117378; Tue, 1 Dec 2026 15:44:12 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 1986D281DA; Tue, 1 Dec 2026 12:44:09 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796129045; b=VM7mbxJKBRqRM0TxsAFj80sjA3L6dY6Pnf072MQ3sEddmZQ/2VkT3dZL0hLIAbM/XTn7 mh1sXpGOw6Y6VtTaGOBCxB+vACZTyE5KM8FEWP0JjCUENEtE4Rm49cnJMpf3BKhxQD0SY 8gHW/nEW6qPOx1JJFmnIjRW4R7Tnb3uOnk7LVeQYdjAElGRBpXb30//N44iAbEYR3NLPM +Okwguy978K04RGNladLn3r3tCGnFck80mpC0/eeJpD/7MVAZAuAFv9aybX+Z6K73YKft nvIa7sM0Fl6TWtzz5xV9pTG+ej76xEk3Tw24Zvvgiz1l7A4PGMyUXNPsPjTorQ+LyyA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796129045; h=X-Original-To:Received:DMARC-Filter:Received:X-Virus-Scanned: Received:Received:DKIM-Filter:DKIM-Signature:Received:Received:From: To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy; bh=181MtahV75EJ5jLTxwNpadjinSp9cy7Sv8hGIHaGG+E=; b=Rc2ckHAI7VS2AGCLRy8Qxc63eGNo9vf/uXIEVQ2ck7KbFSQwHiwV5wi3tEIdamJ97mxU g15mFbjgcCr6BHDp1ApDaPpON+3eA7fTp0PxymHEeQvTOqtvGNbBOciSn6IMVWBUYAUxy vzFtkVmvVHgpF3KoOZI2N5U99E4w3FhMwKFNiga/fAKunXP9c/nMs7NXlAp0M/Sd8xBrx k3eRaXo72jQg3btMMusemLeP7Oh1M4loAsLlN1MG35fL9jzE259XnyM+2viFnoZuYLT5m GiUXTX7AZ5PjLIbQPR1/9x6OuzPpkTQzjZVNu8eEM3VE4AaVVtwyaBHKyMFWb7hEdNw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=OcMQQnpz; dmarc=pass header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F17C606A68A; Tue, 1 Dec 2026 12:44:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=OcMQQnpz X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.96.220.36 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796129044; b=4Ugt/huIHmUoY+q/diEn2Q1v0XDOii6Gs2K3MxEm9K55u8Mwhb6L2NdwY+/c9VxKXExK TIM8iJRM40Sk9nvFR8WodWsd1tejpNozPVg2EHqstGspoFbKdroSwQ+6TzNh33CCzvXbm LJ5MBqu8ZHiJcgnhrlBVwGYBCJZlVNxU0ro1AlBGVU8I7dP66+sli6CVKRBFEXD6HPX3O D7lRT1hrZnEoTkh3nJsV4SCHN1fExkTa0tkLTVNM4Su6fClJY/rFnyROdtrL1JItcjdY1 4UuRbdvsYclbGPfZxeMbl3NN6MAD34RBRp0VClhvciuysbvvIwbblUNvYdlbL/MVaMw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796129044; h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:DKIM-Filter: DKIM-Signature:Received:Received:From:To:CC:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy; bh=181MtahV75EJ5jLTxwNpadjinSp9cy7Sv8hGIHaGG+E=; b=27SAQIzomgr5WWk7zlibL0eTZFh8K749stCZt8hx6AAvXBDZXfhINo34+9S/r97TQHPm 35EIyNCEp3A/+TEhmip94i1C6eSi5ZKO6J2QgOXIDAwXthkXny23w4FMY4C5y5OD0e1/f zJk5bMuX3BKvaoY+CRiODvMb+qoGoxl11QFpQGAYAaKBQYDBK2g4n/VRMgy/OXYl47FQ6 Y4l+3MC4MxScTu/3EI1b5/Dzxxn8JpwLBrtKmfEWNpH4dHR4Qo4pG9u4MCcmgvsvQkc/+ t3CdB/a9NOTVLpTF6v3W+qg6RZR5vR03nh7wT7mUGWxhHLWTaLsSyMh4T+WcJTuHlFw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=OcMQQnpz; arc=none smtp.remote-ip=62.96.220.36 X-Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40944606A681 for <netdev@vger.kernel.org>; Tue, 1 Dec 2026 12:44:04 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 40944606A681 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com X-Received: from localhost (localhost [127.0.0.1]) by mx1.secunet.com (Postfix) with ESMTP id DCF95207B0; Tue, 1 Dec 2026 13:44:02 +0100 (CET) X-Virus-Scanned: by secunet X-Received: from mx1.secunet.com ([127.0.0.1]) by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hMIABdRm07WW; Tue, 1 Dec 2026 13:44:02 +0100 (CET) X-Received: from EXCH-01.secunet.de (rl1.secunet.de [10.32.0.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.secunet.com (Postfix) with ESMTPS id 984AF20854; Tue, 1 Dec 2026 13:44:01 +0100 (CET) X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 984AF20854 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1796129041; bh=181MtahV75EJ5jLTxwNpadjinSp9cy7Sv8hGIHaGG+E=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=OcMQQnpzWjgfaeM5lwR7O841uJCSixc7g6orp8ne6YhCtyH7vBGwxFpSIk5Htz8H5 18kvYZmT2NKmCVWRvdSVzY7ITqRi7GRJmKbdDYFG2EcTuNXlNB0RInFFoUdErLpKnQ VgxJ3qzPO9oqmOQnhU50ogLJC8YVuu036Su0eSN6Wh0ZriKhGt1nWiVfx60kx0rFmB WY3cU6d+JAlwqrygOemSOjx1XwyzbqyXra98O45i864LGUPrHri/30CuUnFQBbdEQZ X+gVtnSAf8qvpWHnrLUZAwNAi9bSsh3nVwlAPt64Avq9zd5xz2cxk+LFkcgPXofzgt wlntV0hoAgyDA== X-Received: from gauss4 (10.182.7.102) by EXCH-01.secunet.de (10.32.0.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Tue, 1 Dec 2026 13:44:00 +0100 X-Received: (nullmailer pid 1165809 invoked by uid 1000); Tue, 01 Dec 2026 12:43:56 -0000 X-CC: Herbert Xu <herbert@gondor.apana.org.au>, Steffen Klassert <steffen.klassert@secunet.com>, <netdev@vger.kernel.org> X-Mailer: git-send-email 2.53.0 X-In-Reply-To: <20261201124252.1163254-1-steffen.klassert@secunet.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-01.secunet.de (10.32.0.171)