diff options
author | Don Brady <[email protected]> | 2017-04-05 15:24:26 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-04-05 14:24:26 -0700 |
commit | 177c91d06e493c436315e324fc7a3ac32ffa2ca7 (patch) | |
tree | a2033f614a67e3c28a9101b4a668a495234dddb3 | |
parent | 6b0ecd2f2f069769218d3001998a78ed8d0a19bc (diff) |
Fix regression in zfs_ereport_start()
On 32-bit platforms spa_state is 32 bits without cast, and thus
caused a NULL pointer dereference when treated as 64bit in
var arg. Accidentally introduced by bcdb96a.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Nathaniel Clark <[email protected]>
Signed-off-by: Don Brady <[email protected]>
Closes #5966
Closes #5965
-rw-r--r-- | module/zfs/zfs_fm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c index 2451bfbc0..6c0b038be 100644 --- a/module/zfs/zfs_fm.c +++ b/module/zfs/zfs_fm.c @@ -269,9 +269,10 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out, fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_POOL, DATA_TYPE_STRING, spa_name(spa), FM_EREPORT_PAYLOAD_ZFS_POOL_GUID, DATA_TYPE_UINT64, spa_guid(spa), - FM_EREPORT_PAYLOAD_ZFS_POOL_STATE, DATA_TYPE_UINT64, spa_state(spa), + FM_EREPORT_PAYLOAD_ZFS_POOL_STATE, DATA_TYPE_UINT64, + (uint64_t)spa_state(spa), FM_EREPORT_PAYLOAD_ZFS_POOL_CONTEXT, DATA_TYPE_INT32, - spa_load_state(spa), NULL); + (int32_t)spa_load_state(spa), NULL); fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE, DATA_TYPE_STRING, |