Page MenuHomeFreeBSD

tcp_timers: check for (INP_TIMEWAIT | INP_DROPPED) only once
ClosedPublic

Authored by glebius on Nov 12 2021, 5:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 22, 2:12 AM
Unknown Object (File)
Wed, Mar 19, 4:16 AM
Unknown Object (File)
Sun, Mar 9, 10:09 AM
Unknown Object (File)
Feb 22 2025, 5:59 AM
Unknown Object (File)
Jan 26 2025, 10:51 PM
Unknown Object (File)
Jan 26 2025, 10:22 PM
Unknown Object (File)
Jan 25 2025, 7:57 PM
Unknown Object (File)
Jan 11 2025, 11:56 AM
Subscribers

Details

Summary

All timers keep inpcb locked through their execution. We need to
check these flags only once. Checking for INP_TIMEWAIT earlier is
is also safer, since such inpcbs point into tcptw rather than tcpcb,
and any dereferences of inp_ppcb as tcpcb are erroneous.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Nov 13 2021, 12:39 PM

This check is occurring lots of places and could have been factored out:

if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
        INP_WUNLOCK(inp);