Project

General

Profile

Bug #5946

zfs_ioc_space_snaps must check that firstsnap and lastsnap refer to snapshots

Added by Andriy Gapon over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2015-05-22
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

At present zfs_ioc_space_snaps() does not do much validation for firstsnap and lastsnap names, nor does it check datasets corresponding to those names.
But dsl_dataset_space_wouldfree asserts that its parameters are snapshots.
Thus, the following panic happens with a debug build if either of the parameters is an existing dataset, which is not a snapshot:

panic: assert: dsl_dataset_is_snapshot(lastsnap)
...
panic()
assfail()
dsl_dataset_space_wouldfree()
zfs_ioc_space_snaps()
zfsdev_ioctl()

See also Issue #5945.

History

#2

Updated by Electric Monk over 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 24218bebb460e4015fac2c9f2cec1902eddbcd7b

commit  24218bebb460e4015fac2c9f2cec1902eddbcd7b
Author: Andriy Gapon <avg@freebsd.org>
Date:   2015-05-29T15:07:56.000Z

    5946 zfs_ioc_space_snaps must check that firstsnap and lastsnap refer to snapshots
    5945 zfs_ioc_send_space must ensure that fromsnap refers to a snapshot
    Reviewed by: Steven Hartland <killing@multiplay.co.uk>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Approved by: Gordon Ross <gordon.ross@nexenta.com>

Also available in: Atom PDF