-
Notifications
You must be signed in to change notification settings - Fork 2.2k
libcontainer/validator: allow setting user.* sysctls inside userns #4889
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
Conversation
|
hmm, failure seems unrelated? |
|
Unfortunately that criu test has been flaky for years, I'll re-run it. |
|
@tych0 wanna add a test for this? Also, some docs on the namespace-aware of these things? Or how did you verify? |
42f8895 to
a30e18a
Compare
|
Good point, I added some tests, thanks. As for docs, there really aren't any. If you read the kernel source, you can see the perms checks: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/ucount.c#n42 The infra was added a long time ago in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dbec28460a89aa7c02c3301e9e108d98272549d2 and has been slowly growing, but I don't think many people are aware of it. |
|
Yeah the ucount stuff is a really well hidden interface, I think I only found out about it when Eric sent patches related to it a few years ago and it was like I'd found some lost treasure. |
a30e18a to
dda2fc1
Compare
These sysctls are all per-userns (termed `ucounts` in the kernel code) are settable with CAP_SYS_RESOURCE in the user namespace. Signed-off-by: Tycho Andersen <[email protected]>
dda2fc1 to
70d88bc
Compare
rata
left a comment
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.
LGTM, thanks!
@tych0 Do you need this in 1.4? It's so simple that I'm fine with it if that is better for you
|
Sure, that would be great! Do i need to cherry pick and send another PR? |
|
Yes, please :). cherry-pick -x would be great and open a PR against the 1.4 branch :) |
|
#4892 thank you! |
These sysctls are all per-userns (termed
ucountsin the kernel code) are settable with CAP_SYS_RESOURCE in the user namespace.