Created attachment 150466 [details] Suggested patch Hi, In the tcp_output() function, nothing is protecting TCP timers from elapsing during its execution. Under certain conditions a TCP timeout can overlap if_transmit() and iff the if_transmit() function returns non-zero in that case, the following repeated check will give a different outcome than previously: ((tp->t_flags & TF_FORCEDATA) == 0 || !tcp_timer_active(tp, TT_PERSIST)) This leads up to a panic where the inpcb transmit state gets corrupted. Suggested solution: Store outcome from previous check and use that result later on. --HPS
I'd prefer to store the value it a local variable, instead of mixing it into flags.
Currently only the first 8 bits of the flags are used, and flags has "int" type, so it shouldn't be a problem. Also it allows us to optimise the flags check in the error case. --HPS
(In reply to Gleb Smirnoff from comment #1) > I'd prefer to store the value it a local variable, instead of mixing it into > flags. Could you suggest a name for this new variable? --HPS
Hans, Do you want to pick a name and open a review for this, please? Cheers, Hiren
Hi, I'd like to re-examine the logic in the patch and see if it still applies. I'll come back to this issue next week. --HPS
I believe Gleb Smirnoff has fixed these issues and is in control of the callout API usage in the TCP stack.