mirror_zfs/lib/libzfs
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
..
.gitignore Add a pkgconfig file 2014-08-28 07:59:43 -07:00
libzfs_changelist.c zfs_handle used after being closed/freed in change_one callback 2019-09-25 11:27:51 -07:00
libzfs_config.c OpenZFS 4521 - zfstest is trying to execute evil "zfs unmount -a" 2017-02-03 13:24:44 -08:00
libzfs_core.pc.in Add a pkgconfig file 2014-08-28 07:59:43 -07:00
libzfs_crypto.c Allow unencrypted children of encrypted datasets 2019-09-25 11:27:48 -07:00
libzfs_dataset.c Fix error message on promoting encrypted dataset 2019-09-25 11:27:48 -07:00
libzfs_diff.c Fix wrong assertion in libzfs diff error handling 2019-05-19 17:31:54 -07:00
libzfs_import.c Improve zpool labelclear 2019-03-21 10:13:01 -07:00
libzfs_iter.c Detect and prevent mixed raw and non-raw sends 2019-03-13 11:00:43 -07:00
libzfs_mount.c Fix race in parallel mount's thread dispatching algorithm 2019-09-25 11:27:49 -07:00
libzfs_pool.c Add feature check for 'zpool resilver' command 2019-05-02 16:42:31 -07:00
libzfs_sendrecv.c Fix error text for EINVAL in zfs_receive_one() 2019-09-25 11:27:48 -07:00
libzfs_status.c Add missing MMP status code to libzfs_status 2019-01-03 12:15:46 -08:00
libzfs_util.c Increase default zcmd allocation to 256K 2019-09-25 11:27:50 -07:00
libzfs.pc.in Add libnvpair to libzfs pkg-config 2019-09-25 11:27:48 -07:00
Makefile.am Include third party licenses in dist tarballs 2019-01-08 09:29:34 -08:00
THIRDPARTYLICENSE.openssl Encryption patch follow-up 2017-10-11 16:54:48 -04:00
THIRDPARTYLICENSE.openssl.descrip Encryption patch follow-up 2017-10-11 16:54:48 -04:00