]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy()
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Fri, 4 Nov 2022 18:06:14 +0000 (14:06 -0400)
committerGitHub <noreply@github.com>
Fri, 4 Nov 2022 18:06:14 +0000 (11:06 -0700)
commit993ee7a00670667f97d990aa5e38eb5cf5effc37
tree867561c2325d96b4d3cff33866462782db06ac24
parentf66ffe68787f9675ad7cce7644a1f81f28a86939
FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy()

There is an off by 1 error in the check. Fortunately, this function does
not appear to be used in kernel space, despite being compiled as part of
the kernel module. However, it is used in userspace. Callers of
lzc_ioctl_fd() likely will crash if they attempt to use the
unimplemented request number.

This was reported by FreeBSD's coverity scan.

Reported-by: Coverity (CID 1432059)
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14135
module/os/freebsd/zfs/zfs_ioctl_compat.c