freebsd-dev/sys/netinet/cc
Matt Macy 2269988749 NULL out cc_data in pluggable TCP {cc}_cb_destroy
When ABE was added (rS331214) to NewReno and leak fixed (rS333699) , it now has
a destructor (newreno_cb_destroy) for per connection state. Other congestion
controls may allocate and free cc_data on entry and exit, but the field is
never explicitly NULLed if moving back to NewReno which only internally
allocates stateful data (no entry contstructor) resulting in a situation where
newreno_cb_destory might be called on a junk pointer.

 -    NULL out cc_data in the framework after calling {cc}_cb_destroy
 -    free(9) checks for NULL so there is no need to perform not NULL checks
     before calling free.
 -    Improve a comment about NewReno in tcp_ccalgounload

This is the result of a debugging session from Jason Wolfe, Jason Eggleston,
and mmacy@ and very helpful insight from lstewart@.

Submitted by: Kevin Bowling
Reviewed by: lstewart
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16282
2018-07-22 05:37:58 +00:00
..
cc_cdg.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
cc_chd.c NULL out cc_data in pluggable TCP {cc}_cb_destroy 2018-07-22 05:37:58 +00:00
cc_cubic.c NULL out cc_data in pluggable TCP {cc}_cb_destroy 2018-07-22 05:37:58 +00:00
cc_cubic.h cc_cubic: 2018-05-03 15:01:27 +00:00
cc_dctcp.c NULL out cc_data in pluggable TCP {cc}_cb_destroy 2018-07-22 05:37:58 +00:00
cc_hd.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
cc_htcp.c NULL out cc_data in pluggable TCP {cc}_cb_destroy 2018-07-22 05:37:58 +00:00
cc_module.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
cc_newreno.c NULL out cc_data in pluggable TCP {cc}_cb_destroy 2018-07-22 05:37:58 +00:00
cc_newreno.h Add support for the experimental Internet-Draft "TCP Alternative Backoff with 2018-03-19 16:37:47 +00:00
cc_vegas.c NULL out cc_data in pluggable TCP {cc}_cb_destroy 2018-07-22 05:37:58 +00:00
cc.c Add support for the experimental Internet-Draft "TCP Alternative Backoff with 2018-03-19 16:37:47 +00:00
cc.h CC Cubic: fix underflow for cubic_cwnd() 2018-03-26 19:53:36 +00:00