HomeFreeBSD

netlink: Zero-initialize writer structures allocated on the stack

Description

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

Details

Provenance
markjAuthored on Jan 26 2023, 3:46 PM
Reviewer
melifaro
Differential Revision
D38213: netlink: Zero-initialize writer structures allocated on the stack
Parents
rG0d0ca120a79f: LinuxKPI: pci.h move function declaration to top of file.
Branches
Unknown
Tags
Unknown