Message ID | 20231210020200.1539875-1-dongchenchen2@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | f99cd56230f56c8b6b33713c5be4da5d6766be1f |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: Remove acked SYN flag from packet in the transmit queue correctly | expand |
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Sun, 10 Dec 2023 10:02:00 +0800 you wrote: > syzkaller report: > > kernel BUG at net/core/skbuff.c:3452! > invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.7.0-rc4-00009-gbee0e7762ad2-dirty #135 > RIP: 0010:skb_copy_and_csum_bits (net/core/skbuff.c:3452) > Call Trace: > icmp_glue_bits (net/ipv4/icmp.c:357) > __ip_append_data.isra.0 (net/ipv4/ip_output.c:1165) > ip_append_data (net/ipv4/ip_output.c:1362 net/ipv4/ip_output.c:1341) > icmp_push_reply (net/ipv4/icmp.c:370) > __icmp_send (./include/net/route.h:252 net/ipv4/icmp.c:772) > ip_fragment.constprop.0 (./include/linux/skbuff.h:1234 net/ipv4/ip_output.c:592 net/ipv4/ip_output.c:577) > __ip_finish_output (net/ipv4/ip_output.c:311 net/ipv4/ip_output.c:295) > ip_output (net/ipv4/ip_output.c:427) > __ip_queue_xmit (net/ipv4/ip_output.c:535) > __tcp_transmit_skb (net/ipv4/tcp_output.c:1462) > __tcp_retransmit_skb (net/ipv4/tcp_output.c:3387) > tcp_retransmit_skb (net/ipv4/tcp_output.c:3404) > tcp_retransmit_timer (net/ipv4/tcp_timer.c:604) > tcp_write_timer (./include/linux/spinlock.h:391 net/ipv4/tcp_timer.c:716) > > [...] Here is the summary with links: - [net] net: Remove acked SYN flag from packet in the transmit queue correctly https://git.kernel.org/netdev/net/c/f99cd56230f5 You are awesome, thank you!
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index eb13a55d660c..aa8983e9ef9f 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3293,7 +3293,13 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) if (skb_still_in_host_queue(sk, skb)) return -EBUSY; +start: if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { + if (unlikely(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)) { + TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_SYN; + TCP_SKB_CB(skb)->seq++; + goto start; + } if (unlikely(before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))) { WARN_ON_ONCE(1); return -EINVAL;