🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17057

Re: [PATCH nf v3] ipvs: ftp: do not link expectations to unconfirmed conntracks

#17057
From: Pablo Neira Ayuso
Date: Mon, 16 Nov 2026 10:51
49 lines
10104 bytes
On Mon, Nov 16, 2026 at 01:15:06PM +0300, Theodor Arsenij Larionov Trichkine wrote:
> ip_vs_ftp_out() can link an expectation to an unconfirmed conntrack. A
> later extension add on the same packet, such as seqadj in
> ip_vs_update_conntrack() or NAT, then reallocates ct->ext and leaves the
> expectation pointing into the freed area:
> 
>   BUG: KASAN: slab-use-after-free in nf_ct_unlink_expect_report+0x490/0x4c0
>   Write of size 8 at addr ffff888004dd4e48 by task syz.2.17/649
> 
> Link the expectation only to a confirmed conntrack.
> 
> Fixes: b25adce16064 ("ipvs: correct usage/allocation of seqadj ext in ipvs")
> Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
> ---
> v3: skip unconfirmed conntracks, as suggested by Pablo; v2 did not
> cover NAT.
> v2: https://lore.kernel.org/netdev/20261113011447.2357709-8-pablo@netfilter.org/
> 
>  net/netfilter/ipvs/ip_vs_ftp.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
> index 44de99f4d187..cb0cdc35a7c1 100644
> --- a/net/netfilter/ipvs/ip_vs_ftp.c
> +++ b/net/netfilter/ipvs/ip_vs_ftp.c
> @@ -398,8 +398,10 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
>  						   end - start,
>  						   buf, buf_len);
>  		if (mangled) {
> -			ip_vs_nfct_expect_related(skb, ct, n_cp,
> -						  ipvsh->protocol, 0, 0);
> +			if (nf_ct_is_confirmed(ct))

I think this is coming a bit late?

Maybe it is possible to check this earlier in this path?

> +				ip_vs_nfct_expect_related(skb, ct, n_cp,
> +							  ipvsh->protocol,
> +							  0, 0);
>  			if (skb->ip_summed == CHECKSUM_COMPLETE)
>  				skb->ip_summed = CHECKSUM_UNNECESSARY;
>  			/* csum is updated */
> -- 
> 2.34.1
> 
Technical Details
Message-ID: <avrgKSO8nfTnv4iL@chamomile>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364207-linux-kernel-netdev=dewy.ru
References: <20261116101506.98853-1-theodorlarionov@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364207-linux-kernel-netdev=dewy.ru
From: pablo@netfilter.org (Pablo Neira Ayuso)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH nf v3] ipvs: ftp: do not link expectations to unconfirmed
 conntracks
Date: Mon, 16 Nov 2026 11:51:21 +0100
Organization: Usenet Network
Message-ID: <avrgKSO8nfTnv4iL@chamomile>
References: <20261116101506.98853-1-theodorlarionov@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
	logging-data="2038750"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/mhQxo9y36FfWqK6f4P7/F0jQmw= sha256:jn12nURBzGk/46nxBXuHJ0RtIuzeucRu0M1mIlta7FY=
	sha1:/Z7HC7Tvw55XPRM2XfAicUbNfw4= sha256:/ql0cXEhOfgC1YFDUFgAQiTw51xYmRvBTwz3mAnBpkA=
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 B874C114BA9; Mon, 16 Nov 2026 13:51:52 +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=netfilter.org
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 Xx6X1izPY2l1;
	Mon, 16 Nov 2026 13:51:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364207-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 36165114BA5; Mon, 16 Nov 2026 13:51:33 +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 14DE52B240; Mon, 16 Nov 2026 10:51:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1794826289;
	b=SVb34+LqYVjk/DGwxg5Qv1wuoBhctv83YNvVG5eO82Fiv88ghPXA3lS9PgadhzLS1WXs
	 KjPOBmh21Xbv35PtFoM53fEDDvK+VyWEtfykczzLlBLwGbnrlPgcL6gkq7TjAl92PEHtD
	 TSXYLuxtTPYHDORQIm+TShZagNxFCSiNwVCANoaL1y5yobfRLFt7zOkjd1AXxERyNeodZ
	 RY9naLeXR3X0WnCFMsS19wGn67tyK/qJz1zFEMcMkQa9WNcS94WwrY3eJ9kpHLYASVaTu
	 bibijIeMVQ92J8ALU5uktAltU8CyOaSNrMFp6ykH9k3jFO29ypwgz5KXLiLK3Yxbljg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794826289;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature: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;
	bh=3zuBeh62F0goKLBBSQZ74NJDoh/EALPwFHfvTfhMEjI=;
	b=0yNxtksRiGH2Wsgy28bH7lpHkAi8LP61jWXR7ITIXh3t4ivc0+/nCrcJNsXyWoleox42
	 Q1Ldhlq55VUR/R8vO4DkL/9WUCAL+/jbWR0ThlSCz/S0eK5V1g5A9WsI1VUZ/4QqFBb2Z
	 GEoXok17DHpAi+qYf/JI7YAyRWszpe1D0DvzVeQd6rC4bpxTntkIkeNgHTW3E1LjEAA4d
	 yA4VpJTe13wVvYLNgUV7HjxwJZ9wxGRRtAJ45Hke2doKqSAJxaObZwYg64lo9xOpBRoQ9
	 GpXAcUyEnIztod3DXH1/9V9sJRd9L9mP49qWyqjcbk7FCqmGw0oT8jne8S/U9OFXhYw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=tytOb2wC;
	dmarc=none header.from=netfilter.org;
	spf=pass smtp.mailfrom=netfilter.org;
	arc=fail 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 43AE7606A335;
	Mon, 16 Nov 2026 10:51:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=tytOb2wC
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794826288;
	b=X8eiJiZr5f7viz/MHBvdhvO1Y+RrZc0MFP00lCBmMfF75Y3H6+r/WzdjhywSk7OCCjlh
	 wM4iLtrHwjF/uIa32oS1SWm21HTpzKnRN6+WeRFiqEgPCAcSfIU02SkPwNYVqhTG4+CNN
	 g8dZBHBnTe5pUDlsktdiDoPBtZOIT5V0nnaTeHapXTXt5w3zhDNWdAehNDe66oaYOHjMR
	 YX7L6W1gapM/VjUp13LcZ0UJOvW/pfkL6ax3/Vj/piejILS4dbFdK+cT9vCuPxiCDH2uY
	 7C16wGYoM3ERwJXNMWLjevOjf8hfeC9N5frboGRmwz9pDCkAqX95ORDU2pdcg5N6G0g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794826288;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To:X-Spam-Status:X-Spam-Checker-Version;
	bh=3zuBeh62F0goKLBBSQZ74NJDoh/EALPwFHfvTfhMEjI=;
	b=TXd1pYaVVtpcb5f0CaTTv3/uN3CfD6lpOvnE8A7juZyuQSzqfVXQVA9nQnG53pvJHQel
	 BA7J6PcOvU8Uty+myiwEmwo3lbIVd0bbB+yPyjeQolK1rvLxIyFh+KRmqLGaSgOmXnW38
	 XbTqdbL/caOyptFY0MoNSoKGjIOedWu6eTQnjW6Vg7AuElyppxkawU85CeLEdwwYwcrNY
	 TJ1jteh96tFGGIPv9gMDzjReD/g0rVkjVzmX0KR86yuYyzSGI7tDPoTQwiz6XxTspI8k+
	 YvBuaE1cVvIRDrCzTtz2uLW2HOkUrZjibV/C5QbleNrLGzGzPNnvbhj7ksbwvbEZMMA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=netfilter.org;
	spf=pass smtp.mailfrom=netfilter.org;
	dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=tytOb2wC;
	arc=none smtp.remote-ip=217.70.190.124
X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id 5CE3A606A31C;
	Mon, 16 Nov 2026 10:51:26 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5CE3A606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;
	s=2025; t=1794826284;
	bh=3zuBeh62F0goKLBBSQZ74NJDoh/EALPwFHfvTfhMEjI=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=tytOb2wCxBecChVYvF5oFCpUEwLOItiSxNbM05bzgA8BuO6keKMc9djPuMMR0doSK
	 TdvCdx5H6EP8ZvxEMM4gzr2LD9JtKEWL+XecXmd6zp9CD3zuMEJRQLEr9S0p6BbMuZ
	 EUknlRlBO+GxUYcNIsvmBFCw/Fo5iN5+xIWlr7uK+R89HUXVxnuW9Kg3VhadGnev5S
	 aCHgTIVn2x4Bl0du54cQhaysO1J2woySi3zAOjTek0qmgI4p1tfceccyKJv7cdlD91
	 kFfbF5xwf/rv9PnC9Kx5x860nkqDKQA/6QKSjGgccxlEyV37+n9Hze7dlMXHAOYi5J
	 ahHnm4BVws42w==
X-Received: from netfilter.org (mail-agni [217.70.190.124])
	by mail.netfilter.org (Postfix) with UTF8SMTPSA id 4246A60055;
	Mon, 16 Nov 2026 11:51:24 +0100 (CET)
X-Cc: Julian Anastasov <ja@ssi.bg>, Simon Horman <horms@verge.net.au>,
	Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
	lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	netdev@vger.kernel.org, coreteam@netfilter.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: <20261116101506.98853-1-theodorlarionov@gmail.com>