diff options
author | Adrian Chadd <[email protected]> | 2020-10-15 13:02:43 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-11-10 15:53:13 -0800 |
commit | 79a357c2a1fb42f9539af57aa729ca175a8115b9 (patch) | |
tree | 3c0237f028ddd887bd395dff5bcfc24021581eb2 /lib/libzutil | |
parent | a4ae4998cbae3bb451642272738ab4d59b9714c4 (diff) |
Fix pointer-is-uint64_t-sized assumption in the ioctl path
This shows up when compiling freebsd-head on amd64 using gcc-6.4.
The lib32 compat build ends up tripping over this assumption.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes #11068
Closes #11069
Diffstat (limited to 'lib/libzutil')
-rw-r--r-- | lib/libzutil/os/freebsd/zutil_compat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libzutil/os/freebsd/zutil_compat.c b/lib/libzutil/os/freebsd/zutil_compat.c index 3e70fef1e..baaf4b598 100644 --- a/lib/libzutil/os/freebsd/zutil_compat.c +++ b/lib/libzutil/os/freebsd/zutil_compat.c @@ -55,7 +55,7 @@ zcmd_ioctl_compat(int fd, int request, zfs_cmd_t *zc, const int cflag) switch (cflag) { case ZFS_CMD_COMPAT_NONE: ncmd = _IOWR('Z', request, zfs_iocparm_t); - zp.zfs_cmd = (uint64_t)zc; + zp.zfs_cmd = (uint64_t)(uintptr_t)zc; zp.zfs_cmd_size = sizeof (zfs_cmd_t); zp.zfs_ioctl_version = ZFS_IOCVER_OZFS; break; @@ -64,7 +64,7 @@ zcmd_ioctl_compat(int fd, int request, zfs_cmd_t *zc, const int cflag) ncmd = _IOWR('Z', newrequest, zfs_iocparm_t); zc_c = malloc(sizeof (zfs_cmd_legacy_t)); zfs_cmd_ozfs_to_legacy(zc, zc_c); - zp.zfs_cmd = (uint64_t)zc_c; + zp.zfs_cmd = (uint64_t)(uintptr_t)zc_c; zp.zfs_cmd_size = sizeof (zfs_cmd_legacy_t); zp.zfs_ioctl_version = ZFS_IOCVER_LEGACY; break; |