diff options
author | Ryan Moeller <[email protected]> | 2020-09-30 16:25:50 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-30 13:25:50 -0700 |
commit | d688beb19110b21cbfd3e3053833b9d4ec6a277c (patch) | |
tree | 078ab3a570f12486f38c3aa976dd1ee242f7c22e /module/os/freebsd/zfs/zfs_ioctl_compat.c | |
parent | 1cb8202b1b0b5810ab9eaecd19fc84f8ffb874d9 (diff) |
FreeBSD: Fix legacy compat for platform IOCs
The request number is out of bounds of the platform table.
Subtract the starting offset to get the correct subscript.
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10994
Diffstat (limited to 'module/os/freebsd/zfs/zfs_ioctl_compat.c')
-rw-r--r-- | module/os/freebsd/zfs/zfs_ioctl_compat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/os/freebsd/zfs/zfs_ioctl_compat.c b/module/os/freebsd/zfs/zfs_ioctl_compat.c index 8dec8644c..81967bed7 100644 --- a/module/os/freebsd/zfs/zfs_ioctl_compat.c +++ b/module/os/freebsd/zfs/zfs_ioctl_compat.c @@ -322,8 +322,10 @@ zfs_ioctl_ozfs_to_legacy(int request) if (request > ZFS_IOC_LAST) return (-1); - if (request > ZFS_IOC_PLATFORM) + if (request > ZFS_IOC_PLATFORM) { + request -= ZFS_IOC_PLATFORM + 1; return (zfs_ioctl_ozfs_to_legacy_platform_[request]); + } if (request >= sizeof (zfs_ioctl_ozfs_to_legacy_common_)/sizeof (long)) return (-1); return (zfs_ioctl_ozfs_to_legacy_common_[request]); |