Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2C5A633F595 for ; Sun, 9 Aug 2026 04:20:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786249232; cv=none; b=PfjM5jbnVNWJkaYxZX9UFKY4AmJXdd5C07uvW1bMpYaNpTvI8hrl37Fvn0iDsw0KC6vtydpteAGsemYZB4jY2Cpg4j0+05WiSDhmh3KOJpSrwxRfoUsm4DYnwCJaYHGyBP0D7JMI12XfyTtaZRSn9JNhhBpZPnFKpzXHvyP+vTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786249232; c=relaxed/simple; bh=0YQyqo0cnVr1LnOGbouJoZbHJQj1AroKMCpg1kF0hj8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jMMueqdpm+VoOoq1Cq1+MnU1JHXH4Ga0EIWmg1R1SANbQCRhEJWubSgkFM20GkRLZ35nKp0xH8J7MVGycW8Zxx6n25empY0Xfjmc/5nDDn64EDzoDxnpOWlCVsE/yz08EI+IkomcvHEYLoC38JUmyPe5RXCfKJsCaujmWbaKrww= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z6n5UGpM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z6n5UGpM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 625D61F00A3A; Sun, 9 Aug 2026 04:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786249231; bh=qR35ZJMTzRpmZCxAnEM7aqryOat1uiMIZxFknbdVIYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Z6n5UGpMFZWgzEYsPf1WxIocMY3YcZtHVRAU55G3QCQGviL9GzVr7FK5pHlHC/zYd Pwa1yMOl/UaqS0qPVxNoSbTMM+2vVTIc8p7tj7dPSoxofBPMjnbZfuAjEhbrWUHlna D10dDSVjz9lPr0uuBKeYKDH0RYv+fnlPrgbHa4uDvAlKEDSgDHqDV2KBey8w4hYGYR r76l8QyVREGexB1o1MljhKHAeCZBnHF6hXgBQySeC7i5x3glUCSyL/xiMhn3RgzGLE LMMC6P8TZDvWmXkUtCMwp/ycSjdKps+msyhUeJwW9TJnYR9GVNBGiwS6lsqSk1cghx bly0qEd7t7nUA== From: Sasha Levin To: stable@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Chia-Yu Chang , Eric Dumazet , "David S. Miller" , Sasha Levin Subject: [PATCH 6.12.y 1/4] tcp: Pass flags to __tcp_send_ack Date: Sun, 9 Aug 2026 00:20:25 -0400 Message-ID: <20260809042028.1093837-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026072944-maritime-sulfide-d951@gregkh> References: <2026072944-maritime-sulfide-d951@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Ilpo Järvinen [ Upstream commit 9866884ce8ef25338c5b33cbb97c2b5d92088528 ] Accurate ECN needs to send custom flags to handle IP-ECN field reflection during handshake. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller Stable-dep-of: a28c4fcbf774 ("tcp: challenge ACK for non-exact RST in SYN-RECEIVED") Signed-off-by: Sasha Levin --- include/net/tcp.h | 2 +- net/ipv4/bpf_tcp_ca.c | 2 +- net/ipv4/tcp_dctcp.h | 2 +- net/ipv4/tcp_output.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 5d39b0e8dd909..e57b03bc3fa88 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -668,7 +668,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority, enum sk_rst_reason reason); int tcp_send_synack(struct sock *); void tcp_push_one(struct sock *, unsigned int mss_now); -void __tcp_send_ack(struct sock *sk, u32 rcv_nxt); +void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags); void tcp_send_ack(struct sock *sk); void tcp_send_delayed_ack(struct sock *sk); void tcp_send_loss_probe(struct sock *sk); diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c index 554804774628e..e01492234b0b3 100644 --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c @@ -121,7 +121,7 @@ static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log, BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt) { /* bpf_tcp_ca prog cannot have NULL tp */ - __tcp_send_ack((struct sock *)tp, rcv_nxt); + __tcp_send_ack((struct sock *)tp, rcv_nxt, 0); return 0; } diff --git a/net/ipv4/tcp_dctcp.h b/net/ipv4/tcp_dctcp.h index d69a77cbd0c75..4b0259111d816 100644 --- a/net/ipv4/tcp_dctcp.h +++ b/net/ipv4/tcp_dctcp.h @@ -28,7 +28,7 @@ static inline void dctcp_ece_ack_update(struct sock *sk, enum tcp_ca_event evt, */ if (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) { dctcp_ece_ack_cwr(sk, *ce_state); - __tcp_send_ack(sk, *prior_rcv_nxt); + __tcp_send_ack(sk, *prior_rcv_nxt, 0); } inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW; } diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index d2d8e989aac7c..296102ed4a96a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -4250,7 +4250,7 @@ void tcp_send_delayed_ack(struct sock *sk) } /* This routine sends an ack and also updates the window. */ -void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) +void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags) { struct sk_buff *buff; @@ -4279,7 +4279,7 @@ void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) /* Reserve space for headers and prepare control bits. */ skb_reserve(buff, MAX_TCP_HEADER); - tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK); + tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK | flags); /* We do not want pure acks influencing TCP Small Queues or fq/pacing * too much. @@ -4294,7 +4294,7 @@ EXPORT_SYMBOL_GPL(__tcp_send_ack); void tcp_send_ack(struct sock *sk) { - __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); + __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt, 0); } /* This routine sends a packet with an out of date sequence -- 2.53.0