Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dataset cloning and renaming to and from an encryption root #15475

Closed
wants to merge 1 commit into from

Conversation

mmatuska
Copy link
Contributor

@mmatuska mmatuska commented Nov 1, 2023

Motivation and Context

We intend to keep all datasets with an identical encryption root inside the child dataset hierarchy of the encryption root.

Currently it is forbidden to move an encrypted dataset ouside its encryption root but this is incomplete. We need to prevent cloning an encrypted dataset outside of its encryption root and renaming or cloning an unencrypted dataset under an encryption root.

Description

  • forbid cloning of an encrypted dataset outside its encryption root
  • forbid cloning an unencrypted dataset inside an encryption root
  • forbit moving an unencrypted dataset inside an encryption root

How Has This Been Tested?

Tested on FreeBSD

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

We intend to keep all datasets with an identical encryption root
inside the child dataset hierarchy of the encryption root.

Currently it is forbidden to move an encrypted dataset ouside its
encryption root but this is incomplete. We need to prevent cloning
an encrypted dataset outside of its encryption root and renaming or
cloning an unencrypted dataset under an encryption root.

Signed-off-by:	Martin Matuska <mm@FreeBSD.org>
@scineram
Copy link

scineram commented Nov 1, 2023

Could you explain why the latter two points are necessary? It seems creating unencrypted child is still allowed.

@rincebrain
Copy link
Contributor

rincebrain commented Nov 1, 2023

Renaming (or creating) an unencrypted one under an encryptionroot is explicitly supposed to be allowed right now, after being initially forbidden. #8870

@mmatuska
Copy link
Contributor Author

mmatuska commented Nov 1, 2023

I am withdrawing this PR. We can clone datasets outside the encryption root, as the cloned dataset remains tied to the originating snapshot and that makes the encryption root undeletable.

@mmatuska mmatuska closed this Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants