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=1796381024; b=aB3ouI6wuu4G2fTRNO/y8ME+y30hdp1cULrC6zc4W6PgZR5WdHWDePyKvWbHOTdQA9yZ Elez3aulXrSS9mD2PiIO/IfGZOvWKJMwO5BvIwM4FWVZbUGxQK4BgrDUjN9GDNjYZ/KwN mTqXDOWZwFnmoLLdAlOr6epNhBec7GYu5qG/qvzn4xLYkQQDv0kRQEA5hTcoJTXOsCw/q WxPzwz+NLVgIWz/x+Z4ZEZqEXVoZ5Vz1wL0gW2amDrwj5cbV4xzWV+qpdTnWom4hDulEH ynosqQtOcWk/6xfgwkGJELfvUYGXHyD0qUm+15zm4UO5QLMS1lJL6m9IBPybDaSFxXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381024; 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=pUxUNY4/E44qY8BCCbehotU6p/u2MF4nXG5mLUcah90=; b=Trsn3Z/AuV95N2SDmV2vzwGtaEyth1Lm9EU44qwk4LA1l8yo4AhGNwUaITCVC9hu+beK Hm7MeqLTbucGHEwa+E44mor8sBFYfAvICXOw+cD7r97kF2iIgvtKNMqFocUawiqrIC47p lZmXOF1asnZ3ZnC36v3VunuzlGt7H+TeieG1Wid5A8vJF4aDy2lmpqKOhOixoUuao2PZE 7cHfc+6PK82jkW/OJjVaH/HvFSBC/SuHG0nZhwVlffPeUo0idMfE6NsimWSkU2bE2TYgk 6miYU6RnYMKKCXEaMWIwrQPGZnNmJyqQlWgSaATOPrSLgdwmdb9DJs47qx62+r7GduQ== 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=IaCqYmZy; 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 B8EBF606A322; Fri, 4 Dec 2026 10:43:44 +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=IaCqYmZy Received: by smtp.kernel.org (Postfix) with ESMTPSA id 339001F000CE; Fri, 4 Dec 2026 10:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381024; bh=pUxUNY4/E44qY8BCCbehotU6p/u2MF4nXG5mLUcah90=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IaCqYmZydRjN1803FkTokxWvKep0kwNvYkqGLlflhdFCwVme6GOBpPhhtcuUnrrov 0gVXv7pCsMGMgYV27CDK2g+BM5Gg9DdVqoct+eLhAGy8eamqYFfXaWNtw3qISBm0hk 5W8/7zrncAh7e+nhdZxmzZmMEO57Q+RRefzxkhAU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Theodor Arsenij Larionov Trichkine , Julian Anastasov , Pablo Neira Ayuso Subject: [PATCH 7.3 523/742] ipvs: ftp: skip conntrack templates in ip_vs_ftp_out Date: Fri, 4 Dec 2026 19:06:27 +0900 Message-ID: <20261204100649.062145021@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodor Arsenij Larionov Trichkine commit 4656934d460da68382cf91766a1ff2d0610554ae upstream. A CT target hooked after conntrack attaches its template to a packet that conntrack left without an entry. On an IPVS FTP PASV/EPSV reply, ip_vs_ftp_out() then mangles with the template and creates an expectation with the template as master. Deleting the CT rule frees the template and leaves the expectation, so a later expectation flush reads freed memory: BUG: KASAN: slab-use-after-free in nf_ct_unlink_expect_report Reachable with CAP_NET_ADMIN in a user namespace. Skip templates, as nft_ct and nfnetlink_queue do. Fixes: f4bc17cdd205 ("ipvs: netfilter connection tracking changes") Cc: stable@vger.kernel.org Signed-off-by: Theodor Arsenij Larionov Trichkine Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/ipvs/ip_vs_ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c @@ -368,7 +368,7 @@ static int ip_vs_ftp_out(struct ip_vs_ap buf_len = strlen(buf); ct = nf_ct_get(skb, &ctinfo); - if (ct) { + if (ct && !nf_ct_is_template(ct)) { bool mangled; /* If mangling fails this function will return 0