Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.96.220.36 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== 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== 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 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 ; Tue, 1 Dec 2026 12:44:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 40944606A681 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com 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 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 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) 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) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 984AF20854 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== 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 Received: (nullmailer pid 1165809 invoked by uid 1000); Tue, 01 Dec 2026 12:43:56 -0000 From: Steffen Klassert To: David Miller , Jakub Kicinski CC: Herbert Xu , Steffen Klassert , Subject: [PATCH 14/22] xfrm: espintcp: select receive path by skb protocol Date: Tue, 1 Dec 2026 13:41:40 +0100 Message-ID: <20261201124252.1163254-15-steffen.klassert@secunet.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261201124252.1163254-1-steffen.klassert@secunet.com> References: <20261201124252.1163254-1-steffen.klassert@secunet.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-01.secunet.de (10.32.0.171) From: Zihan Xi 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 Signed-off-by: Zihan Xi Signed-off-by: Steffen Klassert --- 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