Skip to content

Commit 92d6b39

Browse files
Adrian ChaddRageLtMan
authored andcommitted
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 openzfs#11068 Closes openzfs#11069
1 parent fc05801 commit 92d6b39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/libzutil/os/freebsd/zutil_compat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ zcmd_ioctl_compat(int fd, int request, zfs_cmd_t *zc, const int cflag)
5555
switch (cflag) {
5656
case ZFS_CMD_COMPAT_NONE:
5757
ncmd = _IOWR('Z', request, zfs_iocparm_t);
58-
zp.zfs_cmd = (uint64_t)zc;
58+
zp.zfs_cmd = (uint64_t)(uintptr_t)zc;
5959
zp.zfs_cmd_size = sizeof (zfs_cmd_t);
6060
zp.zfs_ioctl_version = ZFS_IOCVER_OZFS;
6161
break;
@@ -64,7 +64,7 @@ zcmd_ioctl_compat(int fd, int request, zfs_cmd_t *zc, const int cflag)
6464
ncmd = _IOWR('Z', newrequest, zfs_iocparm_t);
6565
zc_c = malloc(sizeof (zfs_cmd_legacy_t));
6666
zfs_cmd_ozfs_to_legacy(zc, zc_c);
67-
zp.zfs_cmd = (uint64_t)zc_c;
67+
zp.zfs_cmd = (uint64_t)(uintptr_t)zc_c;
6868
zp.zfs_cmd_size = sizeof (zfs_cmd_legacy_t);
6969
zp.zfs_ioctl_version = ZFS_IOCVER_LEGACY;
7070
break;

0 commit comments

Comments
 (0)