mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-06 00:00:49 +03:00
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 <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10994
This commit is contained in:
parent
775afc4dcd
commit
5d61d6e8dd
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user