Skip to content

Incremental receives can destroy snapshots without the destroy permission #16943

Closed
@randomnetcat

Description

@randomnetcat

System information

Type Version/Name
Distribution Name NixOS
Distribution Version 25.05.20250108.bffc22e (Warbler)
Kernel Version 6.6.69
Architecture x86_64
OpenZFS Version zfs-2.2.7-1

Describe the problem you're observing

If a user is delegated the receive permission, they can use zfs receive -F on that dataset to destroy snapshots, even when they have not been granted the rollback or destroy permission on the same dataset.

This may be as intended, but it is extremely surprising to me as a user. At the very least, the documentation should be updated to make this clear.

Describe how to reproduce the problem

# As root:
zfs create rpool/test
zfs create rpool/test/src
zfs create rpool/test/dest
zfs allow -u user send,snapshot,receive,mount,hold,create rpool/test

# As user:
zfs snapshot rpool/test/src@a
zfs send -R rpool/test/src@a | zfs receive rpool/dest
zfs snapshot rpool/test/src@b
zfs snapshot rpool/test/dest@x
zfs send -I rpool/test/src@a rpool/test/src@b | zfs receive -F rpool/test/dest

Results: rpool/test/dest has two snapshots, @a and @b. rpool/test/dest@x has been destroyed, despite the fact that user did not have permission to destroy it directly. I would expect that user does not have a way to do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: DefectIncorrect behavior (e.g. crash, hang)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions