mirror of https://github.com/openzfs/zfs.git
Initialize all fields in zfs_log_xvattr()
When logging TX_SETATTR, we could otherwise fail to initialize part of the corresponding ZIL record depending on which fields are present in the xvattr. Initialize the creation time and the AV scan timestamp to zero so that uninitialized bytes are not written to the ZIL. This was found using KMSAN. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Mark Johnston <markj@FreeBSD.org> Closes #12383
This commit is contained in:
parent
da27b8bc7f
commit
03363b2f86
|
@ -126,9 +126,11 @@ zfs_log_xvattr(lr_attr_t *lrattr, xvattr_t *xvap)
|
|||
|
||||
/* Now pack the attributes up in a single uint64_t */
|
||||
attrs = (uint64_t *)bitmap;
|
||||
crtime = attrs + 1;
|
||||
scanstamp = (caddr_t)(crtime + 2);
|
||||
*attrs = 0;
|
||||
crtime = attrs + 1;
|
||||
bzero(crtime, 2 * sizeof (uint64_t));
|
||||
scanstamp = (caddr_t)(crtime + 2);
|
||||
bzero(scanstamp, AV_SCANSTAMP_SZ);
|
||||
if (XVA_ISSET_REQ(xvap, XAT_READONLY))
|
||||
*attrs |= (xoap->xoa_readonly == 0) ? 0 :
|
||||
XAT0_READONLY;
|
||||
|
|
Loading…
Reference in New Issue