From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795045580; b=toCr+xFtmeWSVa/IsnWxVD2L58IlBops1eNVC31T9p3zC5yxEHLVgTOGp7UY1n5t7MHp yaJFPOKtaeJWqJuTS8HBhmM5IEgqmyl0i/HwRON7/nplxtbrQZ6YBsaHmJW9zWmQAA4/+ 9MhCj9dmEArYlpnyIT/FzhVyFojBzBGdmj6aYe+KDq17HB87Ix4tCesF3fsbBwZoCcuh3 CPOvC0hOS7MzbDA7haWAWbLkc2DMYR/sUqE9Rrj6EbRtYZZlyF7dVqQyQEe5rKY92yCf0 8fhMI6Rq1VGlcNXhggZ4rR9Udlb7ubK0ED00Ri5YlbdKtKfBBVEiDZK8jWHdzr5itxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795045580; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=2laSgCQ064dQgdXPjYBboJuvBUXIJKVpL3UZyBCw584=; b=qbUb7joR6suvhc3M2EBYxkeeCIy7DYGDrwW+TWiaJ6RenMU6dUc/7l89Dm0OwML2y9tC J1gk0RYpqSvrgIizpKSiarP3mhT7RbFecp5Z7OMhmMEoCdrEAKN7lejOgb5NMqNdM5ygS JreiJSfwGklQiCD6ruzYM+9coVahkeUDRXXfnDC3iL1aAZgznwBKLbwyDdr2Ns2ppssG4 3HgNg09xtdVElmvxA5zJeH5UKFkkK2WlwooN9VA8wkjBE/8WJ81Q9zREzi5CmPO+clT0A dOe+FvfScvHA9/GmIEp83GaFfWquFOM9kVrWSIELAcpsfyRjSj3hbZwYYc1F51jzDvA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MiHqSzkn; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA486606A32A; Wed, 18 Nov 2026 23:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MiHqSzkn Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A1761F000C4; Wed, 18 Nov 2026 23:46:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795045580; bh=2laSgCQ064dQgdXPjYBboJuvBUXIJKVpL3UZyBCw584=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MiHqSzkneW76oblanfImwQgybxWY8rwOO99Md5AigjBNuAWbv3OewnxF+zpWSLR6A 8HxArkI6e+74IPwRhAwNhGTA1vukBpudSFgYLbkm2F0f2UF6bZn28MYlaMFOQuEQC0 Bx0+xgM+xu023ZoJDJ8exHOUf3Nvwqla8uF9wrFw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vega , Eric Dumazet , Fernando Fernandez Mancera , Zixuan Chai , Ren Wei , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 0973/2857] ipv6: defrag: orphan skb before queuing Date: Wed, 18 Nov 2026 15:33:27 +0100 Message-ID: <20261118150236.640801514@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150201.293410965@linuxfoundation.org> References: <20261118150201.293410965@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@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 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zixuan Chai [ Upstream commit 5dfa91a5ec53cfbf907a1fca095ac3ac7a4e94c9 ] IPv4 and nf_conntrack fragment queues orphan skbs before returning -EINPROGRESS, but ip6_frag_queue() leaves the socket association intact. Commit 18685451fc4e ("inet: inet_defrag: prevent sk release while still in use") moved skb_orphan() into ip_frag_queue() and nf_ct_frag6_queue(), but missed ip6_frag_queue(). Without orphaning, inet_frag_reasm_finish() clears fp->sk on frag_list skbs but leaves fp->destructor set to sock_pfree. Freeing the reassembled skb then calls sock_pfree() with a NULL socket. A socket using SOCK_RCU_FREE may also be released while its fragment is queued, leaving a stale socket pointer; this is a second consequence of the same missing orphan. Orphan the skb before returning -EINPROGRESS so the queued fragment no longer retains the socket association or destructor. Fixes: cf7fbe660f2d ("bpf: Add socket assign support") Cc: stable@vger.kernel.org Reported-by: Vega Reviewed-by: Eric Dumazet Reviewed-by: Fernando Fernandez Mancera Signed-off-by: Zixuan Chai Signed-off-by: Ren Wei Link: https://patch.msgid.link/5c396b7011168cd98b9812df4d6bbd00a96048e7.1791008591.git.petalzu987@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv6/reassembly.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 32ba4417eb1de..fc9babcd94517 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -222,6 +222,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, } skb_dst_drop(skb); + skb_orphan(skb); return -EINPROGRESS; insert_error: -- 2.53.0