Page MenuHomeFreeBSD

tcp: remove goto and address another NULL deref in SACK
ClosedPublic

Authored by rscheff on Jun 8 2022, 6:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 4:17 AM
Unknown Object (File)
Sat, Oct 26, 9:23 AM
Unknown Object (File)
Oct 22 2024, 2:48 AM
Unknown Object (File)
Oct 21 2024, 2:02 PM
Unknown Object (File)
Sep 20 2024, 5:34 PM
Unknown Object (File)
Sep 16 2024, 12:26 PM
Unknown Object (File)
Sep 4 2024, 3:10 AM
Unknown Object (File)
Sep 3 2024, 11:20 PM

Details

Summary

Missed another NULL dereference during KASSERTS after traversing
the scoreboard. While at it, scratch the goto by making the
traversal conditional.

Diff Detail

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

Event Timeline

hselasky added inline comments.
sys/netinet/tcp_sack.c
971–972

The NULL check should be inside the if (SEQ_GEQ()).

sys/netinet/tcp_sack.c
962

I would just write the code like this:

for (;;) {
hole = TAILQ_NEXT(hole, scblink);
if (hole == NULL)
return (hole);
if ....
   break;
}
962

To avoid duplicated NULL checks.

  • unconditional loop, with checks inside
This revision was not accepted when it landed; it landed in state Needs Review.Jun 8 2022, 7:39 AM
This revision was automatically updated to reflect the committed changes.