]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/boot/mips/uboot/Makefile
MFV r316925: 6101 attempt to lzc_create() a filesystem under a volume results in...
authorAndriy Gapon <avg@FreeBSD.org>
Wed, 24 May 2017 22:34:54 +0000 (22:34 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Wed, 24 May 2017 22:34:54 +0000 (22:34 +0000)
commit8816c0bb48c2b46e4fde06af2c672909980d07f5
tree249eb62957b8a9d9fb1b70284305a3a048c0ace5
parente73f9f8a49583edb2b1dc3183049b873918da06c
parentb7db959db3af0868c71afdfdbd6f75fcb4d66312
MFV r316925: 6101 attempt to lzc_create() a filesystem under a volume results in a panic

illumos/illumos-gate@b127fe3c059af7adf772735498680b4f2e1405ef
https://github.com/illumos/illumos-gate/commit/b127fe3c059af7adf772735498680b4f2e1405ef

https://www.illumos.org/issues/6101
  lzc_create(), or more correctly, zfs_ioc_create() does not reject an attempt to
  create a filesystem as a child of a volume, instead it proceeds to a crash.
  A crash stack obtained on FreeBSD:
  page fault while in kernel mode

  zap_leaf_lookup()
  fzap_lookup()
  zap_lookup_norm()
  zap_lookup()
  zfs_get_zplprop()
  zfs_fill_zplprops_impl()
  zfs_ioc_create()
  zfsdev_ioctl()
  devfs_ioctl_f()
  kern_ioctl()
  sys_ioctl()
  This crash happened with a kernel without debugging assertions.
  The immediate cause of crash appears to an attempt to interpret a zvol object
  as a zap object.
  For filesystems:
  #define MASTER_NODE_OBJ 1
  For zvols:
  #define ZVOL_OBJ                1ULL
  #define ZVOL_ZAP_OBJ            2ULL
  So, I see two problems here:
     1. an attempt to create a filesystem under a zvol should be rejected as
        early as possible, maybe in zfs_fill_zplprops()
     2. maybe zap_lookup / zap_lockdir should reject objects that are not of one
        of the zap object types

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 2 weeks
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c