aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/uipc_socket.c3
-rw-r--r--sys/kern/uipc_usrreq.c2
-rw-r--r--sys/netinet/in_pcb.c3
-rw-r--r--sys/netinet/ip_divert.c1
-rw-r--r--sys/netinet/raw_ip.c1
-rw-r--r--sys/netinet/sctp_sysctl.c3
-rw-r--r--sys/netinet/tcp_subr.c5
-rw-r--r--sys/netinet/udp_usrreq.c1
-rw-r--r--sys/netinet6/ip6_mroute.c3
-rw-r--r--sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c1
10 files changed, 15 insertions, 8 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 6f75fc29f46e..4fcbd8f0f76b 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -4007,6 +4007,7 @@ void
sotoxsocket(struct socket *so, struct xsocket *xso)
{
+ bzero(xso, sizeof(*xso));
xso->xso_len = sizeof *xso;
xso->xso_so = (uintptr_t)so;
xso->so_type = so->so_type;
@@ -4025,8 +4026,6 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
xso->so_incqlen = so->sol_incqlen;
xso->so_qlimit = so->sol_qlimit;
xso->so_oobmark = 0;
- bzero(&xso->so_snd, sizeof(xso->so_snd));
- bzero(&xso->so_rcv, sizeof(xso->so_rcv));
} else {
xso->so_state |= so->so_qstate;
xso->so_qlen = xso->so_incqlen = xso->so_qlimit = 0;
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index b8baf89d9ae1..b1e9b8b4ee00 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1809,7 +1809,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
/*
* OK, now we're committed to doing something.
*/
- xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK);
+ xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK | M_ZERO);
UNP_LINK_RLOCK();
gencnt = unp_gencnt;
n = unp_count;
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index cd9ebec7a848..69d9fe13baaa 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -2883,11 +2883,10 @@ void
in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb *xi)
{
+ bzero(xi, sizeof(*xi));
xi->xi_len = sizeof(struct xinpcb);
if (inp->inp_socket)
sotoxsocket(inp->inp_socket, &xi->xi_socket);
- else
- bzero(&xi->xi_socket, sizeof(struct xsocket));
bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo));
xi->inp_gencnt = inp->inp_gencnt;
xi->inp_ppcb = (uintptr_t)inp->inp_ppcb;
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index e96c8135e5da..96c1664b795e 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -664,6 +664,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
if (error != 0)
return (error);
+ bzero(&xig, sizeof(xig));
xig.xig_len = sizeof xig;
xig.xig_count = n;
xig.xig_gen = gencnt;
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 276170d788c9..aa9d3d95356f 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1060,6 +1060,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
n = V_ripcbinfo.ipi_count;
INP_INFO_WUNLOCK(&V_ripcbinfo);
+ bzero(&xig, sizeof(xig));
xig.xig_len = sizeof xig;
xig.xig_count = n;
xig.xig_gen = gencnt;
diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c
index b5c7fbc82753..ef9db21d3e4c 100644
--- a/sys/netinet/sctp_sysctl.c
+++ b/sys/netinet/sctp_sysctl.c
@@ -395,6 +395,9 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS)
SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM);
return (EPERM);
}
+ memset(&xinpcb, 0, sizeof(xinpcb));
+ memset(&xstcb, 0, sizeof(xstcb));
+ memset(&xraddr, 0, sizeof(xraddr));
LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) {
SCTP_INP_RLOCK(inp);
if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) {
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 20b31a1b0ed0..59402b53c50a 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -556,6 +556,7 @@ sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS)
cnt++;
#endif
if (req->oldptr != NULL) {
+ bzero(&tfi, sizeof(tfi));
tfi.tfi_refcnt = f->tf_fb->tfb_refcnt;
tfi.tfi_id = f->tf_fb->tfb_id;
(void)strncpy(tfi.tfi_alias, f->tf_name,
@@ -2154,6 +2155,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
if (error != 0)
return (error);
+ bzero(&xig, sizeof(xig));
xig.xig_len = sizeof xig;
xig.xig_count = n + m;
xig.xig_gen = gencnt;
@@ -3215,8 +3217,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *xt)
struct tcpcb *tp = intotcpcb(inp);
sbintime_t now;
+ bzero(xt, sizeof(*xt));
if (inp->inp_flags & INP_TIMEWAIT) {
- bzero(xt, sizeof(struct xtcpcb));
xt->t_state = TCPS_TIME_WAIT;
} else {
xt->t_state = tp->t_state;
@@ -3244,7 +3246,6 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *xt)
bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack,
TCP_FUNCTION_NAME_LEN_MAX);
- bzero(xt->xt_logid, TCP_LOG_ID_LEN);
#ifdef TCP_BLACKBOX
(void)tcp_log_get_id(tp, xt->xt_logid);
#endif
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index b872a24c3ca1..f9f8c8ae2015 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -887,6 +887,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS)
if (error != 0)
return (error);
+ bzero(&xig, sizeof(xig));
xig.xig_len = sizeof xig;
xig.xig_count = n;
xig.xig_gen = gencnt;
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 9bbcc9ee85fa..87b6a1f323fe 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -203,7 +203,8 @@ sysctl_mif6table(SYSCTL_HANDLER_ARGS)
struct mif6_sctl *out;
int error;
- out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, M_WAITOK);
+ out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP,
+ M_WAITOK | M_ZERO);
for (int i = 0; i < MAXMIFS; i++) {
out[i].m6_flags = mif6table[i].m6_flags;
out[i].m6_rate_limit = mif6table[i].m6_rate_limit;
diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
index 10f4c5adcf09..f11de1c6167e 100644
--- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
+++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
@@ -1810,6 +1810,7 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS)
if (error != 0)
return (error);
+ bzero(&xig, sizeof(xig));
xig.xig_len = sizeof xig;
xig.xig_count = n;
xig.xig_gen = 0;