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

capability: use pr_CAP_AMBIENT_CLEAR_ALL to reduce pr_CAP_AMBIENT_LOWER syscall #164

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

lifubang
Copy link
Contributor

When we want to set ambient capability for current process/thread, we can clear it first, and set them later one by one.
We don't need to clear all supported but unused capabilities one by one.

Close #163

@lifubang lifubang force-pushed the ambient-clearall-first branch from 5f8565f to cc3a106 Compare September 27, 2024 16:10
@kolyshkin
Copy link
Collaborator

kolyshkin commented Sep 27, 2024

This is definitely an improvement, thank you!

Can we have a test case added?

@lifubang lifubang force-pushed the ambient-clearall-first branch 2 times, most recently from d24b995 to 472a317 Compare October 1, 2024 01:13
Copy link
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

Since this is moby/sys repo which contain a bunch of packages, can you please prepend each commit title with capability: prefix?

…ER syscall

Signed-off-by: lfbzhm <lifubang@acmcoder.com>
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
@lifubang lifubang force-pushed the ambient-clearall-first branch from 472a317 to 97c671e Compare October 7, 2024 01:44
Copy link
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin kolyshkin changed the title use pr_CAP_AMBIENT_CLEAR_ALL to reduce pr_CAP_AMBIENT_LOWER syscall capability: use pr_CAP_AMBIENT_CLEAR_ALL to reduce pr_CAP_AMBIENT_LOWER syscall Oct 10, 2024
@kolyshkin kolyshkin merged commit da487b0 into moby:main Oct 10, 2024
19 checks passed
@lifubang lifubang deleted the ambient-clearall-first branch October 15, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

capability: reduce prctl syscall when setting ambient cap set
2 participants