Skip to content

Commit

Permalink
net-tcp_bbr: v2: set tx.in_flight for skbs in repair write queue
Browse files Browse the repository at this point in the history
Syzkaller was able to use TCP_REPAIR to reproduce the new warning
added in tcp_fragment():

  WARNING: CPU: 0 PID: 118174 at net/ipv4/tcp_output.c:1487
    tcp_fragment+0xdcc/0x10a0 net/ipv4/tcp_output.c:1487()
  inconsistent: tx.in_flight: 0 old_factor: 53

The warning happens because skbs inserted into the tcp_rtx_queue
during the repair process go through a sort of "fake send" process,
and that process was seting pcount but not tx.in_flight, and thus the
warnings (where old_factor is the old pcount).

The fix of setting tx.in_flight in the TCP_REPAIR code path seems
simple enough, and indeed makes the repro code from syzkaller stop
producing warnings. Running through kokonut tests, and will send out
for review when all tests pass.

Effort: net-tcp_bbr
Origin-9xx-SHA1: 330f825a08a6fe92cef74d799cc468864c479f63
Change-Id: I0bc4a790f040fd4239620e1eedd5dc64666c6f05
Signed-off-by: Alexandre Frade <kernel@xanmod.org>
  • Loading branch information
nealcardwell authored and xanmod committed Oct 3, 2022
1 parent 12b1c17 commit deaeafb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
skb_set_delivery_time(skb, tp->tcp_wstamp_ns, true);
list_move_tail(&skb->tcp_tsorted_anchor, &tp->tsorted_sent_queue);
tcp_init_tso_segs(skb, mss_now);
tcp_set_tx_in_flight(sk, skb);
goto repair; /* Skip network transmission */
}

Expand Down

0 comments on commit deaeafb

Please sign in to comment.