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

Harden service file: Set OOMScoreAdjust to -1000 #563

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

Cropi
Copy link
Member

@Cropi Cropi commented Nov 1, 2022

From the systemd.exec(5) man page:

OOMScoreAdjust=
      Sets the adjustment value for the Linux kernel's Out-Of-Memory (OOM) killer score for
      executed processes. Takes an integer between -1000 (to disable OOM killing of processes of
      this unit) and 1000 (to make killing of processes of this unit under memory pressure very
      likely). 

The out-of-memory killer in the kernel can easily kill the usbguard-daemon for example when unauthorized process creates many small processes, which causes the OOM algorithm to see usbguard-daemon as the best candidate to be killed, instead of aiming
at some of those unprivileged processes. I have not seen an example of this in practice, but I think it would be good to include.

…Out-Of-Memory (OOM) killer score for executed processes
Copy link
Contributor

@hartwork hartwork left a comment

Choose a reason for hiding this comment

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

Seems like a good idea 👍

@Cropi Cropi self-assigned this Nov 16, 2022
@Cropi Cropi merged commit 4ecec22 into USBGuard:master Nov 16, 2022
@Cropi Cropi deleted the service-hardening branch November 16, 2022 07:43
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.

2 participants