Article View: linux.kernel.netdev
Article #8805Re: [PATCH ipsec v2] xfrm4: use a full socket for local errors
From: Steffen Klassert
Date: Fri, 30 Oct 2026 09:36
Date: Fri, 30 Oct 2026 09:36
33 lines
10994 bytes
10994 bytes
On Thu, Oct 22, 2026 at 10:26:22AM +0800, Fourie Zhang wrote:
> From: Fourie Zhang <fouriezhang@tencent.com>
>
> xfrm4_local_error() passes skb->sk to inet_sk() and ip_local_error()
> without ensuring it points to a full socket. TCP SYN-ACK skbs can be owned
> by TCP_NEW_SYN_RECV request sockets.
>
> xfrm4_tunnel_check_size() already checks sk_fullsock() since commit
> 1620c88887b1 ("xfrm: Fix the usage of skb->sk"), so iptfs_is_too_big() is
> the only remaining IPv4 caller passing a request socket here: the sk it
> tests is the listener, while skb->sk is the request socket.
>
> When IP-TFS rejects such an skb because it exceeds its payload MTU, the
> local error path treats the request socket as a struct inet_sock. KASAN
> reports a slab-out-of-bounds read in ip_local_error() beyond the
> request_sock_TCP allocation.
>
> Resolve the skb owner with skb_to_full_sk() before accessing inet_sock
> state or reporting the error. This maps a request socket to its listener
> and rejects sockets that cannot be used as full sockets, matching what
> commit 6973a21ee73c ("ipv6: xfrm: use full sockets in local error paths")
> did for xfrm6_local_error().
>
> Fixes: 0e4fbf013fa5 ("xfrm: iptfs: add user packet (tunnel ingress) handling")
> Cc: stable@vger.kernel.org
> Reported-by: TencentOS Corvus AI <corvus@tencent.com>
> Link: https://lore.kernel.org/netdev/20260908224856.1591189-1-kuba@kernel.org/
> Reviewed-by: Eric Dumazet <edumazet@kernel.org>
> Assisted-by: tencentos-corvus-ai:hy4-preview
> Signed-off-by: Fourie Zhang <fouriezhang@tencent.com>
Applied, thanks a lot!
Technical Details
Message-ID:
<auRlFmn9TurvAhcS@gauss4>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353632-linux-kernel-netdev=dewy.ruReferences:
<20261022022627.4132880-1-littleddfu@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353632-linux-kernel-netdev=dewy.ru From: steffen.klassert@secunet.com (Steffen Klassert) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH ipsec v2] xfrm4: use a full socket for local errors Date: Fri, 30 Oct 2026 09:36:22 +0000 Organization: Usenet Network Message-ID: <auRlFmn9TurvAhcS@gauss4> References: <20261022022627.4132880-1-littleddfu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: usenet.network; logging-data="2183326"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:tX1+3fFAPO7qxyjh9bO/WuyHlOQ= sha256:6wfy37RE9ylrL1Ej6nBqq8hg38u4LF/nm44cO05MTUc= sha1:JC9kXtKSi48FtjVeqim7aNsuy8E= sha256:VKjuIhSuG760uIpWaAgjsFtFDwBhzsMuK+38zBbQ4zs= Content-Disposition: inline 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 32E9F125C8A; Fri, 30 Oct 2026 10:36:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.049 X-Spam-Status: No, score=-3.049 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.25, 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 tlRPY-ShbPkt; Fri, 30 Oct 2026 10:36:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353632-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 41FD2125C89; Fri, 30 Oct 2026 10:36:27 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 771AF273DD; Fri, 30 Oct 2026 07:36:18 +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=1793345778; b=N8I/cdUcjiDo8jvNaoHhhzHI/Lw1lvawuphNnQbnVU04ZuDJBoY3Ly6sm5tYh2/OxNgf ZYOh2UZ2StQz7U/AzQyk95xA1vdPxefsoQWLU7eaYyAv/5pEZzCHVmMS9VL6bErdinM3x LLUtFagYKB9YIOIpWsU2vkIhpBO/0pmZMVFJ030K2ys1S5/LS4m23lrL3j5LaP0Bl0Ss3 9kJa4Dd1rD4BrcKISOhDdiaaZEINNhOW9GL0H65n0k0/NywqPmjAc+9paF8ONMJlybweK a4DVhF3u2O6dTiWzYLRCT4nZXlRw29gQPwXhnuAHio2t0GY7NBTbc28z+blNhIuaJsw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793345778; h=X-Original-To:Received:DMARC-Filter:Received:X-Virus-Scanned: Received:Received:DKIM-Filter:DKIM-Signature:Received:Received:Date: From:To:CC:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To: X-ClientProxiedBy; bh=EVail0s0Knj5AFc/cqCHQNkhbQFgYUKUKXlSh2CcfVo=; b=K8iklIaYKmrZuIPCpxfLmQHfacvAcbWA84cyd+TA+8LH0xGvs0uB+lredhjpWyVzUT23 hnT1d1tU8lbefyTL6xsfnAfDUssaEvwIkhBxbUQGgH7tWmP+qGW3Emb06DRzPJtYpLqzj mLGtQqxMCKbf/OS3MS067G6kqggx9SSPx/+6Bv5evqaeyh5nW1ZBbG7hvQ9QlwAAkUIfD kjBg6Y8wx+/7KZ3+tAMk2naoLK5ea3k5NehQ/VQRjENITqwDBtWm79tqOeR3I43fEfgWw 3kGA8j35BW3hOkJzxl1ntpZBvY5XCWLAXAAPhIu6EMHQEgyQx2NOdJ6CZdEMPmJbLhQ== 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="rizL/E9T"; 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 31F71606A323; Fri, 30 Oct 2026 07:36:18 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=rizL/E9T 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=1793345772; b=a09739M/P060ItDYCtyCUytSZcHM+aXEBr0dEoLgvAQ+GiseDiywJNv0zNykch0Facy4 WBk0wCMbeoa0pfn9WI4I0RCeD+11HoAB+WnBpkVtPO3273ohb8xV6uZCsLzJpRbP+ta0x 6LF2N0FFWF0akiE6C0KcbEh01H61okkZnJDqD7pva7sc3IJ8yuSeepS5TC8uhiLhdI71d R6ADArmm4p3HQ8tPaj836sC01DR60zcQizdM31wkIHoaYr/IsAnoyaXZ0DkRTj1swLsl3 hAlfvJkXOd0aTVcU3nY8/jMMgHnCx8NPbVcZIre1UvnpkiDR0Dn2HRNFzNp83z4rVbQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793345772; h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:DKIM-Filter: DKIM-Signature:Received:Received:Date:From:To:CC:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To: X-ClientProxiedBy; bh=EVail0s0Knj5AFc/cqCHQNkhbQFgYUKUKXlSh2CcfVo=; b=OXu3x3iIr7g2qfaON1DW706o0+fpAOFVW/KT6e5LaQyDcQEBnUQpoPq0BuRq+uLLg/Kv Bis6Kz0QIWM36GyUcHFcqKwt4ivcImmunKINlPxDou7z8XFdSn5xf6SBRsAY3r0+ajcLe EZ7+q7KVaF6jbK/wC9FahvbwH94P9hZaQ9E4hfOCl5CbV/R2iRY7+ubZWLoHA4MdgHDsI 8ktICp4Zlr51SLPBRXjw8UCw7b5/FrwotDFbjcp70KB2xVLCt6JDH/dG5vYy4gcoZ88RH 8OIOxfOf7PeAjgfNlu7XBx7i6Vu4Q4yMTtks6PGzX45e0p5UFBN9tYzgm75ZYMyelBg== 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="rizL/E9T"; 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 149DB606A31A; Fri, 30 Oct 2026 07:36:09 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 149DB606A31A 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 2B4D5208B7; Fri, 30 Oct 2026 08:36: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 MEBiz5BhQybF; Fri, 30 Oct 2026 08:36:01 +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 44B552083B; Fri, 30 Oct 2026 08:36:01 +0100 (CET) X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 44B552083B X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1793345761; bh=EVail0s0Knj5AFc/cqCHQNkhbQFgYUKUKXlSh2CcfVo=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=rizL/E9To/XigvGgBLhOlA/r0YGVkJe4IjaA67XfG1PhDIQgTTIzXN8RiDtCOcpeM Jr63ZKX7Z5oUONx1/rH0sgzgZ2yZV2OUJ6TBUT/PtJUPyH+2HieqKxVo+hw0AUZgNc hwWVxd6hdbM59u65Mqz2Dcx/eIvpkXS8aZklN0Iau/pSCf4RuTc+TMQiufjVgoHvTY ePZfFgXyvVXHGbz2W0fGPhmbg2wvB7pkgd7fF2hLfNqCHtlEDku2ByRqgMWe9k8hLp xecWS6und7UPFGgj+ET7hlRxNtBGBqFMdcJEoMOxBEIT8YrI4hvab0rTTT/01/mfiw skTbxMjzOxAIQ== 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; Fri, 30 Oct 2026 08:36:00 +0100 X-Received: (nullmailer pid 3372523 invoked by uid 1000); Fri, 30 Oct 2026 09:36:22 -0000 X-CC: Herbert Xu <herbert@gondor.apana.org.au>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Zhiling Zou <zhilinz@nebusec.ai>, TencentOS Corvus AI <corvus@tencent.com>, <netdev@vger.kernel.org>, Fourie Zhang <fouriezhang@tencent.com>, <stable@vger.kernel.org> 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-In-Reply-To: <20261022022627.4132880-1-littleddfu@gmail.com> X-ClientProxiedBy: EXCH-04.secunet.de (10.32.0.184) To EXCH-01.secunet.de (10.32.0.171)