mirror_zfs/include
Richard Yao 72540ea314 zfsdev_getminor() should check for invalid file handles
Unit testing at ClusterHQ found that passing an invalid file handle to
zfs_ioc_hold results in a NULL pointer dereference on a system without
assertions:

IP: [<ffffffffa0218aa0>] zfsdev_getminor+0x10/0x20 [zfs]
Call Trace:
[<ffffffffa021b4b0>] zfs_onexit_fd_hold+0x20/0x40 [zfs]
[<ffffffffa0214043>] zfs_ioc_hold+0x93/0xd0 [zfs]
[<ffffffffa0215890>] zfsdev_ioctl+0x200/0x500 [zfs]

An assertion would have caught this had they been enabled, but this is
something that the kernel module should handle without failing.  We
resolve this by searching the linked list to ensure that the file
handle's private_data points to a valid zfsdev_state_t.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Andriy Gapon <avg@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3506
2015-06-22 17:02:13 -07:00
..
linux Linux 2.6.36 compat, use REQ_FAILFAST_MASK and remove pre-2.6.36 support 2015-05-11 15:07:00 -07:00
sys zfsdev_getminor() should check for invalid file handles 2015-06-22 17:02:13 -07:00
libnvpair.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libuutil_common.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libuutil_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libuutil.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libzfs_core.h Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
libzfs_impl.h Illumos 4368, 4369. 2014-07-29 10:55:29 -07:00
libzfs.h Add libzfs_error_init() function 2015-05-22 13:34:58 -07:00
Makefile.am Kernel header installation should respect --prefix 2014-10-28 09:37:06 -07:00
zfeature_common.h Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
zfs_comutil.h Illumos #2882, #2883, #2900 2013-09-04 15:49:00 -07:00
zfs_deleg.h Illumos 4368, 4369. 2014-07-29 10:55:29 -07:00
zfs_fletcher.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zfs_namecheck.h Illumos 4368, 4369. 2014-07-29 10:55:29 -07:00
zfs_prop.h Check the dataset type more rigorously when fetching properties. 2014-05-06 10:41:46 -07:00
zpios-ctl.h Update code to use misc_register()/misc_deregister() 2014-10-17 14:58:44 -07:00
zpios-internal.h cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00