HomeFreeBSD

gmirror: Zero the metadata block before writing

Description

gmirror: Zero the metadata block before writing

The mirror metadata fields contain string buffers and pad bytes, neither
were being zeroed before metadata was written to disk. Also, the
metadata structure is smaller than the sector size, and in one case
gmirror was failing to zero-fill the full buffer before writing.

Fix these problems by pre-zeroing the metadata structure and the sector
buffer.

Reported by: KMSAN
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7f053a44aef75eab395ce15a1c8a1399a2f89cad)

Details

Provenance
markjAuthored on Jul 13 2021, 9:45 PM
Parents
rGf065d0bb299b: blist: Correct the node count computed in blist_create()
Branches
Unknown
Tags
Unknown