Page MenuHomeFreeBSD

Avoid dereferencing a NULL pointer when TCP_REASS_LOGGING is enabled
ClosedPublic

Authored by tuexen on Feb 19 2019, 10:14 PM.

Details

Summary

This patch addresses an issue brought up by bz@ in D18968: When TCP_REASS_LOGGING is defined (which doesn't compile right now), a NULL pointer dereference would happen, if user data was received during the TCP handshake and BB logging is used.

A KASSERT is also added to detect tcp_reass() calls with illegal parameter combinations.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tuexen created this revision.Feb 19 2019, 10:14 PM
tuexen retitled this revision from Avoid dereferencing a NULL point when TCP_REASS_LOGGING is enabled to Avoid dereferencing a NULL pointer when TCP_REASS_LOGGING is enabled.Feb 20 2019, 6:05 PM
bz added inline comments.Feb 20 2019, 6:30 PM
sys/netinet/tcp_reass.c
547 ↗(On Diff #54094)

Please add %p and others to the printf so people will be able to have pointers to the tp, th, ..., m for debugging in case this fires.
Will also help them to find out which illegal combination it was.

tuexen updated this revision to Diff 54147.Feb 20 2019, 7:23 PM

Address bz@'s comment.

tuexen marked an inline comment as done.Feb 20 2019, 7:26 PM
tuexen added inline comments.
sys/netinet/tcp_reass.c
547 ↗(On Diff #54094)

Good suggestion.Diff updated.

rrs accepted this revision.Feb 20 2019, 8:31 PM
This revision is now accepted and ready to land.Feb 20 2019, 8:31 PM
tuexen marked an inline comment as done.Feb 21 2019, 1:03 AM
This revision was automatically updated to reflect the committed changes.