From 8b88f44f84d7db7d104da5307b288cf88cd5c749 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 7b937958a4f..97e4aa90e02 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -2873,6 +2873,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;