Ingo Blechschmidt
@iblech@mathstodon.xyz
mathstodon.xyz
Replying to
@anselmschueler@ieji.de
@anselmschueler@ieji.de @nixos_org@chaos.social @leah@blahaj.social @identical9213@mastodon.social Sorry, now that I reread these two posts I agree that it's somewhat confusing. It's about two distinct kernel patches.
The patch provided in https://codeberg.org/iblech/secure-suspend is what I originally set out to do. This patch provides a new kernel feature, namely locking+suspending in one go. Without this patch, user space needs to do the locking in a separate step. This opens a short window of time where the encrypted volume is no longer accepting read/write requests, because the key has been wiped from the LUKS data structures, but kernel tasks might still want to access the volume. The inconvenient (but harmless) result: standby fails.
The patch provided in https://lore.kernel.org/all/ajKwRtP8izwRsMmv@quasitopos/ fixes the bug that opening an encrypted volume permanently committed a leftover copy of the volume key in memory which was never wiped (until device close).
This patch fixes the common use case of a LUKS volume on a physical block device, but (as Ondrej Kozina discovered) not the use case where cryptsetup creates a loop device to do its bidding, so it is incomplete.
The upcoming release 2.8.7 of cryptsetup will contain a patch working around the kernel bug.