freebsd-dev/lib
Andriy Gapon 1cb31ff6a4 8168 NULL pointer dereference in zfs_create()
illumos/illumos-gate@690031d326
690031d326

https://www.illumos.org/issues/8168
  If we manage to export the pool on which we are creating a dataset (filesystem
  or zvol) between entering libzfs`zfs_create() and libzfs`zpool_open() call (for
  which we never check the return value) we end up dereferencing a NULL pointer
  in libzfs`zpool_close().
  This was discovered on ZFS on Linux. The same issue can be reproduced on
  Illumos running in parallel:
    while :; do zpool import -d /tmp testpool ; zpool export testpool ; done
    while :; do zfs create testpool/fs; zfs destroy testpool/fs ; done
  Eventually this will result in several core dumps like this one:
  [root@52-54-00-d3-7a-01 /cores]# mdb core.zfs.4244
  Loading modules: [ libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1
  libnvpair.so.1 ld.so.1 ]
  > ::stack
  libzfs.so.1`zpool_close+0x17(0, 0, 0, 8047450)
  libzfs.so.1`zfs_create+0x1bb(8090548, 8047e6f, 1, 808cba8)
  zfs_do_create+0x545(2, 8047d74, 80778a0, 801, 0, 3)
  main+0x22c(8047d2c, fef5c6e8, 8047d64, 8055a17, 3, 8047d70)
  _start+0x83(3, 8047e64, 8047e68, 8047e6f, 0, 8047e7b)
  >
  Fix and reproducer (systemtap): https://github.com/zfsonlinux/zfs/pull/6096

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
2017-06-09 15:00:13 +00:00
..
libctf/common Update vendor/illumos/dist to 14148:fe28bd725808: 2013-08-23 23:34:54 +00:00
libdtrace 7297 clear() on llquantize aggregation causes dtrace to exit 2016-08-26 20:51:09 +00:00
libgen/common Update DTrace userland code to the latest available. 2010-08-02 12:13:33 +00:00
libnvpair 5752 dump_nvlist() is not aware of boolean array 2016-11-02 17:33:22 +00:00
libuutil/common Update vendor/illumos/dist to pre libzfs_core state (zfs part) 2012-07-18 10:19:51 +00:00
libzfs/common 8168 NULL pointer dereference in zfs_create() 2017-06-09 15:00:13 +00:00
libzfs_core/common 7729 libzfs_core`lzc_rollback() leaks result nvl 2017-04-14 18:15:13 +00:00
libzpool/common 7280 Allow changing global libzpool variables in zdb and ztest through command line 2017-04-14 16:53:34 +00:00
pyzfs/common 4369 implement zfs bookmarks 2014-01-01 01:15:53 +00:00