Page MenuHomeFreeBSD

Fix a double-free when an inp transitions to INP_TIMEWAIT state after having been dropped.
ClosedPublic

Authored by jch on Oct 10 2016, 11:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 14 2024, 2:31 AM
Unknown Object (File)
Nov 10 2024, 3:09 PM
Unknown Object (File)
Nov 10 2024, 1:16 AM
Unknown Object (File)
Nov 9 2024, 9:54 PM
Unknown Object (File)
Nov 9 2024, 6:55 PM
Unknown Object (File)
Nov 9 2024, 6:38 PM
Unknown Object (File)
Nov 9 2024, 4:36 PM
Unknown Object (File)
Nov 9 2024, 3:01 PM
Subscribers

Details

Reviewers
girgen
hiren
gnn
slw_zxy.spb.ru
Group Reviewers
transport
Summary

Fix a double-free when an inp transitions to INP_TIMEWAIT state after having been dropped.

This fixes enforces in_pcbdrop() logic in tcp_input():

"in_pcbdrop() is used by TCP to mark an inpcb as unused and avoid future packet
delivery or event notification when a socket remains open but TCP has closed."

PR: 203175
Reported by: Slawa Olhovchenkov, Palle Girgensohn, Urmas Lett, imp
Tested by: Slawa Olhovchenkov
MFC after: 1 week

Test Plan

Slawa can test this patch in 11, Palle might have time to test it in 10.

Diff Detail

Event Timeline

jch retitled this revision from to Fix a double-free when an inp transitions to INP_TIMEWAIT state after having been dropped..
jch updated this object.
jch edited the test plan for this revision. (Show Details)
jch added a reviewer: hiren.

Currently only @slw_zxy.spb.ru and @girgen have reproduced this issue thus are able to validate this change, I have not been able to reproduce it but our TCP QA is all good with this change.

I think imp also have reproduced this issue (https://lists.freebsd.org/pipermail/freebsd-stable/2016-September/085518.html)
Also report Urmas Lett <urmas.lett@eenet.ee> (email to jch)

jch edited edge metadata.

I think imp also have reproduced this issue (https://lists.freebsd.org/pipermail/freebsd-stable/2016-September/085518.html)
Also report Urmas Lett <urmas.lett@eenet.ee> (email to jch)

You are right, added imp and Urmas in "Reported by:".

jch edited edge metadata.

Review from Slawa:

  • log(LOG_ERR) and workaround a difficult to debug case when INVARIANT is not defined
  • Add a tcp_twstart KASSERT

I was testing this patch in 3 days.
No TCP related problems.

PS: Just for record: issuse present from 7.0

I was testing this patch in 3 days.
No TCP related problems.

Excellent, thanks for your time testing it, I am going to push it in HEAD and MFC it.

Still need someone from -transport to approve this review though. :)

gnn edited edge metadata.
This revision is now accepted and ready to land.Oct 17 2016, 2:01 PM

gnn accepted this revision.

Thanks @gnn! Change pushed to HEAD, will be MFC in stable branches.