-
Notifications
You must be signed in to change notification settings - Fork 874
fix: fix oom_score adjustments failing if caps set #15758
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
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.
It'd be great if the test binary you compile could have caps set on it to ensure this works
Agreed it's pretty hard to test without root |
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.
// We drop effective caps prior to setting dumpable so that we limit the | ||
// impact of someone attempting to hijack the process (i.e. with a debugger) | ||
// to take advantage of the capabilities of the agent process. We encourage | ||
// users to set cap_net_admin on the agent binary for improved networking |
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.
Do we mention this in coder.com/docs?
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.
honestly not sure
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.
If not, we probably should (wherever we're documenting the nice/oom adjustments).
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.
Yeah once this is merged and there are no bugs, I'm going to write up some documentation for resource management in Coder
coder
binary has capabilities set on it. This is becausePR_SET_DUMPABLE
is set to0
when a process is executed with elevated capabilities. The fix is to flipPR_SET_DUMPABLE
to1
prior to writing tooom_score_adj
.