git: e0751ae801b3 - main - ip_mroute: Avoid leaking uninitialized bytes to the routing daemon
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Apr 2026 13:28:38 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=e0751ae801b3e29c6dd52905ef1d63d5cd643b0a
commit e0751ae801b3e29c6dd52905ef1d63d5cd643b0a
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-04-24 13:22:51 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-04-24 13:22:51 +0000
ip_mroute: Avoid leaking uninitialized bytes to the routing daemon
Reported by: KMSAN
MFC after: 1 week
---
sys/netinet/ip_mroute.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 359755b19e95..14bd458b74f3 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -2459,13 +2459,14 @@ pim_register_send_upcall(struct mfctable *mfct, struct ip *ip, struct vif *vifp,
/* Send message to routing daemon */
im = mtod(mb_first, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_WHOLEPKT;
- im->im_mbz = 0;
- im->im_vif = vifp - mfct->viftable;
- im->im_src = ip->ip_src;
- im->im_dst = ip->ip_dst;
-
- k_igmpsrc.sin_addr = ip->ip_src;
+ memset(im, 0, sizeof(*im));
+ im->im_msgtype = IGMPMSG_WHOLEPKT;
+ im->im_mbz = 0;
+ im->im_vif = vifp - mfct->viftable;
+ im->im_src = ip->ip_src;
+ im->im_dst = ip->ip_dst;
+
+ k_igmpsrc.sin_addr = ip->ip_src;
MRTSTAT_INC(mrts_upcalls);