From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2335B12C48B; Tue, 30 Apr 2024 10:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714474221; cv=none; b=LeVavwVOMc79VYQCu05riL+D16iHz97FpnRTajn6t6frNX/YUzch7pR5k16SyZ3oIBbhp0PLrdyEB//ovm73w2OzDZ587CZtnSyHBgmv+rCGqfcy7aolZE/UF0MCNSQcJONERfOLyGYzhVAq6Tnd6aY6ejP3Lp0xBC4nT34nFR0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714474221; c=relaxed/simple; bh=voYEgcErQVaMVkciTRp7zsMhk2GT4Xs7rbqXYeG7lEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p83FuQcC6fCBTdS34cwZeTwDT/bmjLLB7wiPnxxZqW5OnsC4RJokimErx4tg8697DbG7KaDPjxpWkPkEdwOWjU/YMOA/H1pAcN2LiFHqzyRoH5T7orJItJOwxi25Y8M59OwG5Dkl4TB9Xe/PNRYhAChENFtPa8bx6tppfbSxkDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BQweahaU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BQweahaU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44DDBC2BBFC; Tue, 30 Apr 2024 10:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714474220; bh=voYEgcErQVaMVkciTRp7zsMhk2GT4Xs7rbqXYeG7lEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BQweahaUmb7S7FHCG4XL6BkU+pccga7Q6BqTSUdcbj8HV9TTZDG7lIA6Y336h2B2S 5bdnlq+UvZ2dDaJPHO42Tafu0+R1VhHVqI6xHeADIJXsX9qOZj8y+mE0LEV8Fl7NCE E2TdeGgBHSX3ia7wHITPvjGcT3aw9ngAJIN7tse0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ismael Luceno , Andreas Taschner , Julian Anastasov , Pablo Neira Ayuso , Sasha Levin , Firo Yang Subject: [PATCH 6.8 092/228] ipvs: Fix checksumming on GSO of SCTP packets Date: Tue, 30 Apr 2024 12:37:50 +0200 Message-ID: <20240430103106.457773062@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430103103.806426847@linuxfoundation.org> References: <20240430103103.806426847@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ismael Luceno [ Upstream commit e10d3ba4d434ed172914617ed8d74bd411421193 ] It was observed in the wild that pairs of consecutive packets would leave the IPVS with the same wrong checksum, and the issue only went away when disabling GSO. IPVS needs to avoid computing the SCTP checksum when using GSO. Fixes: 90017accff61 ("sctp: Add GSO support") Co-developed-by: Firo Yang Signed-off-by: Ismael Luceno Tested-by: Andreas Taschner Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/ipvs/ip_vs_proto_sctp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c index a0921adc31a9f..1e689c7141271 100644 --- a/net/netfilter/ipvs/ip_vs_proto_sctp.c +++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c @@ -126,7 +126,8 @@ sctp_snat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, if (sctph->source != cp->vport || payload_csum || skb->ip_summed == CHECKSUM_PARTIAL) { sctph->source = cp->vport; - sctp_nat_csum(skb, sctph, sctphoff); + if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb)) + sctp_nat_csum(skb, sctph, sctphoff); } else { skb->ip_summed = CHECKSUM_UNNECESSARY; } @@ -174,7 +175,8 @@ sctp_dnat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, (skb->ip_summed == CHECKSUM_PARTIAL && !(skb_dst(skb)->dev->features & NETIF_F_SCTP_CRC))) { sctph->dest = cp->dport; - sctp_nat_csum(skb, sctph, sctphoff); + if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb)) + sctp_nat_csum(skb, sctph, sctphoff); } else if (skb->ip_summed != CHECKSUM_PARTIAL) { skb->ip_summed = CHECKSUM_UNNECESSARY; } -- 2.43.0