]> git.ipfire.org Git - thirdparty/systemd.git/commit
cryptsetup-generator: set high OOM score for systemd-cryptsetup instances
authorMichal Sekletar <msekleta@redhat.com>
Wed, 27 Mar 2019 08:27:21 +0000 (09:27 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Mar 2019 14:52:41 +0000 (15:52 +0100)
commit48da47eeca7a58aecc3512346ab8d4064711c71d
tree86e2aececabe976c91b7b24825f6b91b6fe32730
parente8413b651ba2ca230d73a8df37471ac384979246
cryptsetup-generator: set high OOM score for systemd-cryptsetup instances

With new LUKS2 header format it is possible to use Argon2 key derivation
function. This function is "memory-hard" hence keyslot unlocking can
potentially use a lot of RAM as this increases resistance to massively
parallel GPU based password cracking.

However, when multiple systemd-cryptsetup binaries run at the same
time it is very likely that system using Argon2 (e.g. Fedora 30)
will encounter memory-pressure during early boot, following OOM killing
spree.

This patch aims to lower the damage done by OOM killer and sets OOMScore
for systemd-cryptsetup units to 500. Hopefully OOM killer will then
shoot us down and leave rest of the system services alone.
src/cryptsetup/cryptsetup-generator.c