aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2020-05-07 03:22:57 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2020-05-07 03:22:57 +0000
commitb9e41808820a27421ef81f5cb257f3ad587a2469 (patch)
tree80236be8bc7e99d5a4340baef32b0a0877d13a5e
parente2d83e5b75792258ae77325c3784c1d13be52236 (diff)
downloadsrc-b9e41808820a27421ef81f5cb257f3ad587a2469.tar.gz
src-b9e41808820a27421ef81f5cb257f3ad587a2469.zip
MFC r358023: Don't use uninitialized memory
Don't use uninitialised stack memory if the sysctl variable net.inet.tcp.hostcache.enable is set to 0. The bug resulted in using possibly a too small MSS value or wrong initial retransmission timer settings. Possibly the value used for ssthresh was also wrong. Submitted by: rscheff Reviewed by: Cheng Cui, rgrimes@, tuexen@ Differential Revision: https://reviews.freebsd.org/D23687
Notes
Notes: svn path=/stable/11/; revision=360765
-rw-r--r--sys/netinet/tcp_hostcache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c
index 2a7cbf5710ba..9b5680020a1d 100644
--- a/sys/netinet/tcp_hostcache.c
+++ b/sys/netinet/tcp_hostcache.c
@@ -435,8 +435,10 @@ tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_lite *hc_metrics_lite)
{
struct hc_metrics *hc_entry;
- if (!V_tcp_use_hostcache)
+ if (!V_tcp_use_hostcache) {
+ bzero(hc_metrics_lite, sizeof(*hc_metrics_lite));
return;
+ }
/*
* Find the right bucket.