Skip to content

zfs allow send:raw - #17543

Closed
allanjude wants to merge 2 commits into
openzfs:masterfrom
KlaraSystems:send_encrypted
Closed

allanjude wants to merge 2 commits into
openzfs:masterfrom
KlaraSystems:send_encrypted

Conversation

@allanjude

Copy link
Copy Markdown
Contributor

Motivation and Context

Allow delegation of permission to ONLY send raw encrypted replication.
This allows automated replication processes to only have permission to the raw replication stream, without the ability to send the decrypted version of the stream.

Description

A new zfs allow permission: send:encrypted, similar to the existing send permission, but only allows send with the --raw flag. Any attempt to send without --raw will be denied.
The existing send permission is unchanged, so retains the ability to send either way.

How Has This Been Tested?

Manually, and with new ZTS additions

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)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • 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:

Comment thread man/man8/zfs-allow.8 Resolved
@snajpa

snajpa commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

Why can't it be send:raw, when it is in fact about just that? Raw by far doesn't imply encrypted.

@amotin

amotin commented Jul 17, 2025

Copy link
Copy Markdown
Member

Why can't it be send:raw, when it is in fact about just that? Raw by far doesn't imply encrypted.

Outside of encryption it makes no sense to restrict it. But I agree that raw sounds consistent with the zfs send terminology.

@allanjude

Copy link
Copy Markdown
Contributor Author

Why can't it be send:raw, when it is in fact about just that? Raw by far doesn't imply encrypted.

The permission was originally called sendraw and we changed it to have the : etc and match what other had done with receive: append etc.

If there is a preference to call it send:raw that is fine with us, we'll do the search/replace with the next push to solve the other issues.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jul 18, 2025
@allanjude

Copy link
Copy Markdown
Contributor Author

Fixed a missing line continuation that failed to install some of the tests

Comment thread module/zfs/zfs_ioctl.c Resolved
@behlendorf behlendorf added the Status: Revision Needed Changes are required for the PR to be accepted label Aug 6, 2025
@github-actions github-actions Bot removed the Status: Revision Needed Changes are required for the PR to be accepted label Aug 14, 2025

@behlendorf behlendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally things look good after fixing up the tests.

@behlendorf behlendorf mentioned this pull request Aug 23, 2025
6 of 13 tasks
Comment thread cmd/zfs/zfs_main.c Resolved
Comment thread include/sys/dsl_deleg.h Resolved
@behlendorf behlendorf added the Status: Revision Needed Changes are required for the PR to be accepted label Aug 23, 2025
@behlendorf

Copy link
Copy Markdown
Contributor

I'd love to see this wrapped up so we can pull it in for the final 2.4.

@github-actions github-actions Bot removed the Status: Revision Needed Changes are required for the PR to be accepted label Sep 8, 2025
@amotin amotin changed the title zfs allow send:encrypted zfs allow send:raw Sep 10, 2025
@behlendorf behlendorf added the Status: Revision Needed Changes are required for the PR to be accepted label Sep 10, 2025
allanjude and others added 2 commits September 11, 2025 22:23
A new `zfs allow` permissions that ONLY allows sending replication
streams in raw (encrypted) mode, so encrypted data will not be
decrypted as part of the replication process.

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Co-authored-by: JT Pennington <jt.pennington@klarasystems.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Create tests for the new send:encrypted permission

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Signed-off-by: JT Pennington <jt.pennington@klarasystems.com>
@github-actions github-actions Bot removed the Status: Revision Needed Changes are required for the PR to be accepted label Sep 11, 2025
@allanjude

Copy link
Copy Markdown
Contributor Author

Requested changes applied

@behlendorf behlendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that looks like it'll do the trick.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Sep 11, 2025
behlendorf pushed a commit that referenced this pull request Sep 12, 2025
Create tests for the new send:encrypted permission

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: JT Pennington <jt.pennington@klarasystems.com>
Closes #17543
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Sep 12, 2025
A new `zfs allow` permissions that ONLY allows sending replication
streams in raw (encrypted) mode, so encrypted data will not be
decrypted as part of the replication process.

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Co-authored-by: JT Pennington <jt.pennington@klarasystems.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Closes openzfs#17543
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Sep 12, 2025
Create tests for the new send:encrypted permission

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: JT Pennington <jt.pennington@klarasystems.com>
Closes openzfs#17543
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jan 30, 2026
A new `zfs allow` permissions that ONLY allows sending replication
streams in raw (encrypted) mode, so encrypted data will not be
decrypted as part of the replication process.

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Co-authored-by: JT Pennington <jt.pennington@klarasystems.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Closes openzfs#17543
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jan 30, 2026
Create tests for the new send:encrypted permission

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: JT Pennington <jt.pennington@klarasystems.com>
Closes openzfs#17543
msladek added a commit to msladek/zfs that referenced this pull request Feb 11, 2026
When performing an incremental raw send (-w -I), the kernel was
incorrectly requiring the standard 'send' permission instead of
allowing 'send:raw'. This was due to a strict boolean comparison
on the 'rawok' flag in zfs_secpolicy_send().

This change relaxes the comparison to a standard truthy check and
updates the test suite to properly verify delegated raw send behavior.

Fixes: openzfs#18193
Introduced-by: openzfs#17543

Signed-off-by: Marc Sladek <marc@sladek.dev>
msladek added a commit to msladek/zfs that referenced this pull request Feb 11, 2026
When performing an incremental raw send with intermediates (-w -I),
the kernel was incorrectly requiring the standard 'send' permission
instead of allowing 'send:raw'. This was due to a strict boolean
comparison on the 'rawok' flag in zfs_secpolicy_send().

This change relaxes the comparison to a standard truthy check and
updates the test suite to properly verify delegated raw send behavior.

Fixes: openzfs#18193
Introduced-by: openzfs#17543

Signed-off-by: Marc Sladek <marc@sladek.dev>
@msladek msladek mentioned this pull request Feb 11, 2026
6 of 14 tasks
msladek added a commit to msladek/zfs that referenced this pull request Feb 11, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Fixes: openzfs#18193
Introduced-by: openzfs#17543

Signed-off-by: Marc Sladek <marc@sladek.dev>
behlendorf pushed a commit that referenced this pull request Feb 11, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: #17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes #18198
Closes #18193
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Feb 11, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: openzfs#17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes openzfs#18198
Closes openzfs#18193
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Feb 23, 2026
A new `zfs allow` permissions that ONLY allows sending replication
streams in raw (encrypted) mode, so encrypted data will not be
decrypted as part of the replication process.

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Co-authored-by: JT Pennington <jt.pennington@klarasystems.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Closes openzfs#17543
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Feb 23, 2026
Create tests for the new send:encrypted permission

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: JT Pennington <jt.pennington@klarasystems.com>
Closes openzfs#17543
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jul 30, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: openzfs#17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes openzfs#18198
Closes openzfs#18193
lundman pushed a commit to openzfsonosx/openzfs that referenced this pull request Sep 1, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: openzfs/zfs#17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes #18198
Closes #18193
pull Bot pushed a commit to A-Archives-and-Forks/openzfs that referenced this pull request Sep 26, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: openzfs#17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes openzfs#18198
Closes openzfs#18193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants