Bug 241070 - dumpon: dumpon opens geom devices non-exclusively
Summary: dumpon: dumpon opens geom devices non-exclusively
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-geom mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-05 02:43 UTC by Alan Somers
Modified: 2019-10-05 05:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer 2019-10-05 02:43:58 UTC
dumpon opens geom devices non-exclusively.  This might be required in order to share a device for swap and dump purposes.  However, it's also dangerous as it allows a single device to be used as both a dump device and a storage device.

Steps to reproduce:

> sudo dumpon vtbd1
> sudo zpool create foo vtbd1
Comment 1 commit-hook freebsd_committer 2019-10-05 03:20:19 UTC
A commit references this bug:

Author: asomers
Date: Sat Oct  5 03:19:55 UTC 2019
New revision: 353118
URL: https://svnweb.freebsd.org/changeset/base/353118

Log:
  ZFS: fix several of the "zpool create" tests

  * Remove zpool_create_013_neg.  FreeBSD doesn't have an equivalent of
    Solaris's metadevices.  GEOM would be the equivalent, but since all geoms
    are the same from ZFS's perspective, this test would be redundant with
    zpool_create_012_neg

  * Remove zpool_create_014_neg.  FreeBSD does not support swapping to regular
    files.

  * Remove zpool_create_016_pos.  This test is redundant with literally every
    other test that creates a disk-backed pool.

  * s:/etc/vfstab:/etc/fstab in zpool_create_011_neg

  * Delete the VTOC-related portion of zpool_create_008_pos.  FreeBSD doesn't
    use VTOC.

  * Replace dumpadm with dumpon and swap with swapon in multiple tests.

  * In zpool_create_015_neg, don't require "zpool create -n" to fail.  It's
    reasonable for that variant to succeed, because it doesn't actually open
    the zvol.

  * Greatly simplify zpool_create_012_neg.  Make it safer, too, but not
    interfering with the system's regular swap devices.

  * Expect zpool_create_011_neg to fail (PR 241070)

  * Delete some redundant cleanup steps in various tests

  * Remove some unneeeded ATF timeout specifications.  The default is fine.

  PR:		241070
  MFC after:	2 weeks
  Sponsored by:	Axcient

Changes:
  head/ObsoleteFiles.inc
  head/tests/sys/cddl/zfs/include/commands.txt
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh