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

zdb -dAdvv hides file attributes (e.g. mode) for encrypted datasets (even when keys are loaded) #12707

Closed
riyad opened this issue Oct 30, 2021 · 1 comment · Fixed by #14503
Closed
Labels
Bot: Not Stale Override for the stale bot Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@riyad
Copy link

riyad commented Oct 30, 2021

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 20.10
Kernel Version 5.13.0
Architecture x86_64
OpenZFS Version 2.0.6-1ubuntu2

Describe the problem you're observing

Trying to determine if I'm affected by a data corruption bug (#11474) I had to see if file modes had weird values. Running the test command zdb -dAdvv $FILESYSTEM | grep 'mode\s\+[0-9]' | sort | uniq -c I learned that zdb doesn't show this information for encrypted datasets at all. Instead placeholders like "(bonus encrypted)" and "(object encrypted)" are printed even when the dataset keys are loaded and the datasets are mounted.

Describe how to reproduce the problem

Run zdb -dAdvv on an enctypted dataset:

$ sudo zdb -dAdvv $FILESYSTEM
[...]
    Object  lvl   iblk   dblk  dsize  dnsize  lsize   %full  type
       936    1   128K  25.5K     4K      1K  25.5K  100.00  ZFS plain file
                                               176   bonus  System attributes
        dnode flags: USED_BYTES USERUSED_ACCOUNTED USEROBJUSED_ACCOUNTED 
        dnode maxblkid: 0
                (bonus encrypted)
                (object encrypted)
[...]
@riyad riyad added the Type: Defect Incorrect behavior (e.g. crash, hang) label Oct 30, 2021
@riyad riyad changed the title zdb -dAdvv hides file attributes (e.g. mode) for encryted datasets (even when keys are loaded) zdb -dAdvv hides file attributes (e.g. mode) for encrypted datasets (even when keys are loaded) Oct 30, 2021
@stale
Copy link

stale bot commented Nov 1, 2022

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Nov 1, 2022
@behlendorf behlendorf added Bot: Not Stale Override for the stale bot and removed Status: Stale No recent activity for issue labels Nov 1, 2022
@robn robn mentioned this issue Feb 17, 2023
13 tasks
behlendorf pushed a commit that referenced this issue Mar 2, 2023
The approach is straightforward: for dataset ops, if a key was offered,
find the encryption root and the various encryption parameters, derive a
wrapping key if necessary, and then unlock the encryption root. After
that all the regular dataset ops will return unencrypted data, and
that's kinda the whole thing.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #11551
Closes #12707
Closes #14503
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Mar 3, 2023
The approach is straightforward: for dataset ops, if a key was offered,
find the encryption root and the various encryption parameters, derive a
wrapping key if necessary, and then unlock the encryption root. After
that all the regular dataset ops will return unencrypted data, and
that's kinda the whole thing.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes openzfs#11551
Closes openzfs#12707
Closes openzfs#14503
pcd1193182 pushed a commit to pcd1193182/zfs that referenced this issue Sep 26, 2023
The approach is straightforward: for dataset ops, if a key was offered,
find the encryption root and the various encryption parameters, derive a
wrapping key if necessary, and then unlock the encryption root. After
that all the regular dataset ops will return unencrypted data, and
that's kinda the whole thing.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes openzfs#11551
Closes openzfs#12707
Closes openzfs#14503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot: Not Stale Override for the stale bot Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants