]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
netlink: Zero-initialize writer structures allocated on the stack
authorMark Johnston <markj@FreeBSD.org>
Thu, 26 Jan 2023 15:46:19 +0000 (10:46 -0500)
committerMark Johnston <markj@FreeBSD.org>
Thu, 26 Jan 2023 15:46:19 +0000 (10:46 -0500)
commit7a78ae88659e0f6a901574d17672d1ccdc3e971b
tree66df9c37d9130ad9fcbdc15ec6bc2caad4c1f8af
parent0d0ca120a79ff826d7c2ad84c44359c200460640
netlink: Zero-initialize writer structures allocated on the stack

The prevailing pattern seems to be to simply initialize all fields to
zero.  Without this, it's possible to trigger a branch on uninitialized
memory, specifically, when testing nw->ignore_limit in
nlmsg_refill_buffer().

Initialize the writer structure in a couple of functions where this is
necessary.

Reported by: KMSAN
Reviewed by: melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38213
sys/netlink/route/rt.c