mirror_zfs/lib
Pavel Zakharov 0e765c4eb8 zfs_handle used after being closed/freed in change_one callback
This is a typical case of use after free. We would call zfs_close(zhp)
which would free the handle, and then call zfs_iter_children() on that
handle later.  This change ensures that the zfs_handle is only closed
when we are ready to return.

Running `zfs inherit -r sharenfs pool` was failing with an error
code without any error messages. After some debugging I've pinpointed
the issue to be memory corruption, which would cause zfs to try to
issue an ioctl to the wrong device and receive ENOTTY.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alek Pinchuk <apinchuk@datto.com>
Signed-off-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Issue #7967
Closes #9165
2019-09-25 11:27:51 -07:00
..
libavl Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libefi Remove libefi __linux__ wrappers 2018-06-14 09:43:32 -07:00
libicp Add support for selecting encryption backend 2018-08-02 11:59:24 -07:00
libnvpair config: better libtirpc detection 2019-03-02 16:19:05 -08:00
libshare Fedora 28: Fix misc bounds check compiler warnings 2018-08-26 12:55:44 -07:00
libspl ZFS Reads may result in unneccesary calls to zil_commit 2019-03-22 13:09:11 -07:00
libtpool Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libunicode Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libuutil Update build system and packaging 2018-05-29 16:00:33 -07:00
libzfs zfs_handle used after being closed/freed in change_one callback 2019-09-25 11:27:51 -07:00
libzfs_core Use ZFS_DEV macro instead of literals 2019-09-25 11:27:48 -07:00
libzpool Use ZFS_DEV macro instead of literals 2019-09-25 11:27:48 -07:00
libzutil Sort by full path name instead of by GUID when importing 2019-02-26 11:13:15 -08:00
Makefile.am Add libzutil for libzfs or libzpool consumers 2018-11-05 11:22:33 -08:00