From aa1c5de9d27e71739309f5bcc06363115cbf404e Mon Sep 17 00:00:00 2001 From: Peter Lei Date: Fri, 4 Apr 2025 22:07:09 +0200 Subject: [PATCH] tcp: clear sendfile logging struct The sendfile black box logging struct is much smaller than the encompassing stack specific logging union. Be sure to clear the trailing unused memory when logging. Reviewed by: tuexen Sponsored by: Netflix, Inc. (cherry picked from commit 3bd1e85fc13cb90853046300dcaa31d63b45ee21) --- sys/netinet/tcp_log_buf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index e9ad05382b8..5142b3ebdd7 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -2878,6 +2878,7 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) struct timeval tv; tcp_log_eventspecific_t log; + memset(&log, 0, sizeof(log)); microuptime(&tv); log.u_sf.offset = offset; log.u_sf.length = nbytes;