-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Double-free of encryption wrapping key due to invalid pool properties #8791
Double-free of encryption wrapping key due to invalid pool properties #8791
Conversation
This commits fixes a double-free in zfs_ioc_pool_create() triggered by specifying an unsupported combination of properties when creating a pool with encryption enabled. Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #8791 +/- ##
==========================================
+ Coverage 78.63% 78.79% +0.15%
==========================================
Files 381 381
Lines 117798 117791 -7
==========================================
+ Hits 92636 92812 +176
+ Misses 25162 24979 -183
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the issue. See my one comment.
(void) spa_destroy(spa_name); | ||
unload_wkey = B_FALSE; /* spa_destroy() unloads wrapping keys */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I would move this up just beneath spa_create()
. The issue here is that after spa_create()
runs (without error), it "owns" the dsl crypto key so we should set this variable as soon as that is true (to prevent future problems). This code is equivalent though.
This commits fixes a double-free in zfs_ioc_pool_create() triggered by specifying an unsupported combination of properties when creating a pool with encryption enabled. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #8791
This commits fixes a double-free in zfs_ioc_pool_create() triggered by specifying an unsupported combination of properties when creating a pool with encryption enabled. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#8791
This commits fixes a double-free in zfs_ioc_pool_create() triggered by specifying an unsupported combination of properties when creating a pool with encryption enabled. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#8791
Motivation and Context
This commits fixes a double-free in zfs_ioc_pool_create() triggered by specifying an unsupported combination of properties when creating a pool with encryption enabled.
Description
How Has This Been Tested?
Tested on a Debian with updated test case
Types of changes
Checklist:
Signed-off-by
.