-
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
Fix filesystem_limit enforcement #8280
Conversation
As described in the zfs(8) man page the 'filesystem_limit' does not apply to users who are allowed to change the property. This was incorrectly failing because unlike all other operations the credential was being checked again outside the user context in the syncing context. Checking the stored user credential in a different context will always fail on Linux. See the comment above priv_policy_ns() for details. The proposed solution is to verify the CRED() only in open context and then use the kcred for the same secpolicy_zfs() checks in syncing context: this allows the check to be correctly performed a second time while still verifying the caller credentials. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #8280 +/- ##
==========================================
+ Coverage 68.24% 76.89% +8.64%
==========================================
Files 335 368 +33
Lines 109770 114827 +5057
==========================================
+ Hits 74917 88293 +13376
+ Misses 34853 26534 -8319
Continue to review full report at Codecov.
|
This solution seems to work for "filesystem_limit" but not with "snapshot_limit": for instance in https://github.com/zfsonlinux/zfs/blob/master/module/zfs/dsl_dataset.c#L1463. |
@loli10K any updates coming here? |
@tcaputi this code won't work without modifying every I don't own the hardware to test such a change performance-wise, i'm going to close this. |
See issue openzfs#8226: Property filesystem_limit does not work as documented There have been previous attempts to fix the behavior on Linux, but so far the issue is still open. See PRs openzfs#8228, openzfs#8280. The existing tests pass for the incorrect behavior. This is a problem on FreeBSD; we are failing the tests because we implement the feature correctly. I have adapted the tests based on the work by @loli10K in openzfs#8280 and extended the changes to fix the snapshot_limit test as well. Linux now fails these tests, so entries linking to the issue have been added to the "maybe" group in zts-report.py. Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
See issue openzfs#8226: Property filesystem_limit does not work as documented There have been previous attempts to fix the behavior on Linux, but so far the issue is still open. See PRs openzfs#8228, openzfs#8280. The existing tests pass for the incorrect behavior. This is a problem on FreeBSD; we are failing the tests because we implement the feature correctly. I have adapted the tests based on the work by @loli10K in openzfs#8280 and extended the changes to fix the snapshot_limit test as well. Linux now fails these tests, so entries linking to the issue have been added to the "maybe" group in zts-report.py. Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
See issue #8226: Property filesystem_limit does not work as documented There have been previous attempts to fix the behavior on Linux, but so far the issue is still open. See PRs #8228, #8280. The existing tests pass for the incorrect behavior. This is a problem on FreeBSD; we are failing the tests because we implement the feature correctly. I have adapted the tests based on the work by @loli10K in #8280 and extended the changes to fix the snapshot_limit test as well. Linux now fails these tests, so entries linking to the issue have been added to the "maybe" group in zts-report.py. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10082
See issue openzfs#8226: Property filesystem_limit does not work as documented There have been previous attempts to fix the behavior on Linux, but so far the issue is still open. See PRs openzfs#8228, openzfs#8280. The existing tests pass for the incorrect behavior. This is a problem on FreeBSD; we are failing the tests because we implement the feature correctly. I have adapted the tests based on the work by @loli10K in openzfs#8280 and extended the changes to fix the snapshot_limit test as well. Linux now fails these tests, so entries linking to the issue have been added to the "maybe" group in zts-report.py. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes openzfs#10082
Motivation and Context
Fix #8226
Alternative version #8228
filesystem_limit
should not be enforced for users allowed to change it.Current behaviour:
Patch applied:
Description
The proposed solution is to verify the
CRED()
only in open context and then use thekcred
for the samesecpolicy_zfs()
checks in syncing context: this allows the check to be correctly performed a second time while still verifying the caller credentials.How Has This Been Tested?
Update ZFS Test Suite
Types of changes
Checklist:
Signed-off-by
.