git: 6a09a7f1e9a5 - main - netlink: always zero provided header buffers.
Date: Mon, 01 May 2023 14:09:58 UTC
The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6a09a7f1e9a52fb25158ca60216c6b817f8c0b71 commit 6a09a7f1e9a52fb25158ca60216c6b817f8c0b71 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-05-01 14:07:33 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-05-01 14:09:47 +0000 netlink: always zero provided header buffers. Reported by: KMSAN MFC after: 3 days --- sys/netlink/netlink_message_writer.h | 1 + sys/netlink/route/neigh.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netlink/netlink_message_writer.h b/sys/netlink/netlink_message_writer.h index 57fc1bf342ea..92e43834efc7 100644 --- a/sys/netlink/netlink_message_writer.h +++ b/sys/netlink/netlink_message_writer.h @@ -225,6 +225,7 @@ nlmsg_reserve_data_raw(struct nl_writer *nw, size_t sz) void *data_ptr = &nw->data[nw->offset]; nw->offset += sz; + bzero(data_ptr, sz); return (data_ptr); } diff --git a/sys/netlink/route/neigh.c b/sys/netlink/route/neigh.c index 807c125cc3f0..db72bc9bfd4e 100644 --- a/sys/netlink/route/neigh.c +++ b/sys/netlink/route/neigh.c @@ -156,12 +156,9 @@ dump_lle_locked(struct llentry *lle, void *arg) ndm = nlmsg_reserve_object(nw, struct ndmsg); ndm->ndm_family = wa->family; - ndm->ndm_pad1 = 0; - ndm->ndm_pad2 = 0; ndm->ndm_ifindex = wa->ifp->if_index; ndm->ndm_state = lle_state_to_nl_state(wa->family, lle); ndm->ndm_flags = lle_flags_to_nl_flags(lle); - ndm->ndm_type = 0; switch (wa->family) { #ifdef INET