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=1796389347; b=Cf8Iykbz1HWUFAmX6oKf+x3pzdrQX43K7SyJn4JYSdEw9uijZdVxqc7lPMCxmxX0RtbP d+29jM9TVwhgPgO/PeTkyT5r0PF0XKAOKKWJvcF8sB3Ya/Khph7B9ueurqOsKFxrPO4lA ovWMGKscHc/HZrSbms8pFcSdO1MdHRGG9FW+ZxjgxMDqZCWpN9/iI39zdi1tsEcNxLVEi HCQ44h0v29YrgfW4rqu0P2KUOnzzAd4baUzvJmw1A2K7EdllKig8uoumeCXuuFJsG7C7v EIjxYyfCr7J8LEK+4/znb5yGKqneLsbiosTiKcgXrR7DtfcavnldWJWYe3H1RoaZFaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389347; 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=R7fg8g0XqYZkzaXdmMBnNI+5n3y0RSmr4p1u7onRlrY=; b=MBimI75kn7QcLP/a4nDd4wvWRjBKfnh478I4MCsgjZeaOKr4+BajLfeaUocWcEPJcUJe TSuj8G4h2uC769HrJDWivSRWTxnLx0+khFyyR/9+dC11Me2ulx0ulIBzIBbzHcceNIFeG c2pl81Q3okGHXWIzjj9c+I/XLjlYMdZO/F5ghLsvwOtxjdB+sOVJ9/JT++uJDLS70U28h unlGvikK1aJRV05Yeaz331WRdXietp1rxH261Ybv8XePIGRb9xOcmSKk3Q2GBv3hUZw2J lSqHQ9dPIZof3OKc6kdTdh03ZPSpRcBCaiLhhVMG5VyWOf347yVW6t8WXQS7ift1BXw== 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=IvVI9eMz; 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 0A9EB606A32C; Fri, 4 Dec 2026 13:02:26 +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=IvVI9eMz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A9171F00931; Fri, 4 Dec 2026 13:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389346; bh=R7fg8g0XqYZkzaXdmMBnNI+5n3y0RSmr4p1u7onRlrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IvVI9eMz+SXz18IddT0K5Wsu8xSx5r4UcmNpOhIlCW0ZHIgdd5LdBCWfoCWA/EOBy fwIuyQd9h3yH8BKsEXWz9nNM3rYSL2cI4NcrLInqmZGkMvZqxiRXXYK6Um7LrtMy9d E0iIIn+vLzn8NKHFiunXLDU6aCC/M1enrPUOlpVo= 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 6.1 0958/1059] ipvs: ftp: skip conntrack templates in ip_vs_ftp_out Date: Fri, 4 Dec 2026 19:08:09 +0900 Message-ID: <20261204100708.834632114@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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 6.1-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 @@ -369,7 +369,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