HomeFreeBSD

Initialize "autoreplace" in spa_ld_get_props()

Description

Initialize "autoreplace" in spa_ld_get_props()

spa_prop_find() may fail to find the specified property, in which case
it suppresses ENOENT from zap_lookup(). In this case, the return value
is left uninitialized, so spa_autoreplace was being initialized using an
uninitialized stack variable.

This was found using KMSAN. It appears to be a regression from commit
9eb7b46ed0, which removed the initialization of "autoreplace" from the
definition.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #12383

Details

Provenance
markjAuthored on Jul 16 2021, 1:19 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 26 2021, 6:53 PM
Parents
rG1c24bf966c37: Linux 5.14 compat: explicity assign set_page_dirty
Branches
Unknown
Tags
Unknown

Event Timeline