From 79a357c2a1fb42f9539af57aa729ca175a8115b9 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 15 Oct 2020 13:02:43 -0700 Subject: 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 Reviewed-by: Ryan Moeller Signed-off-by: adrian chadd Closes #11068 Closes #11069 --- lib/libzutil/os/freebsd/zutil_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libzutil') 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; -- cgit v1.2.3