HomeFreeBSD

witness: Unconditionally initialize out-params for witness_save()

Description

witness: Unconditionally initialize out-params for witness_save()

As of LLVM 16, the -fsanitize-memory-param-retval option is set to true
by default, meaning that MSan will eagerly report uninitialized function
parameters and return values, even if they are not used. A
witness_save()/witness_restore() call pair fails this test since
witness_save() may return before saving file and line number
information.

Modify witness_save() to initialize the out-params unconditionally; this
appears to be the only instance of the problem triggered when booting to
a login prompt, so let's just address it directly.

Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
MFC after: 1 week

(cherry picked from commit 7123222220aa563dc16bf1989d335722e4ff57a6)

Details

Provenance
markjAuthored on Oct 16 2023, 5:23 PM
Parents
rG501e1152d2a0: linuxkpi: Fix an assertion in linux_free_kmem()
Branches
Unknown
Tags
Unknown