Memfd_secret() in 5.14
lwn.net
lwn.net
(Context: the discussion is around the drawback that memfd_secret must disable hibernation)
> That's why the only way to introduce new security feature is with “more security” choice being the only option.
> ... eventually, Chrome and Firefox would join the crowd. At that point it would become a moot point if you want to use hibernation or not: you system wouldn't be much useful if you would choose the hibernation.
Always interesting to see how ignorant some "security experts" are and how they love to hijack users and sabotage user experience using the excuse of "security".
This would require some cooperation with the login program, and maybe with the user app, so it's hard to organize in the Linux world. I think something like this is available on Windows, but I'm not sure.
It would be also great if you could use the graphical login (greeter) to decrypt your disk (at boot or after sleep). I think some of the neccessary infrastructure would be the same for both features.
A third option: do neither, and just accept that hibernation temporarily drops the security guarantees that the feature usually offers.
(I'm assuming hibernation is not a requirement outside of the desktop space.)
Another gripe I have about infosec people is that they tend to fear the wrong things. They tend to be paranoid about the minutia of network firewalls and encryption while ignoring the fact that most compromises are inbound and due to malware or phishing.
They will obsess over how “smooth” the firewall is, then type “npm install” as root on production.
We all have dealt with stupid security people just as we've all dealt with stupid people in general. It's unfortunate but competency is on a power curve across disciplines.
But surely, under assumption of arbitrary kernel code execution, a determined payload could restore the relevant direct map mappings, and still access this memory?
Can the latest iPhones boot unsigned OSs yet? I'm guessing the jailbreakers aren't _that_ fast.
https://developer.android.com/training/safetynet/attestation
So yes, some apps will refuse to run and in theory some services could refuse to accept requests from devices that aren't running unmodified images.
I can definitely imagine something like Snapchat using this as they have actually been fairly aggressive at trying to prevent "unauthorized clients" that can save images without notification to the user.
Disabling Secure Boot must not be possible on ARM systems. - WHCP-Systems-Specification-1511.pdf
However, looking at the -2004 spec, both customization and enable/disable sections are prefaced with (Optional for systems intended to be locked down) so it is no longer mandatory, even on x86_64 systems, to provide a physically present user with the ability to disable or customize UEFI Secure Boot. The same language is used in the -21H2 spec for Windows 11.
https://docs.microsoft.com/en-us/windows-hardware/design/com...
That falls squarely under malware, surely?
First, most Linux servers don't care about hibernation, so the issue really just happens for desktops/laptops.
Second, there are at least 3 or 4 suspend states that Linux can offer, hibernation happens to be the most efficient one, but downgrading to a slightly less power efficient suspend state that keeps power in the RAM shouldn't make that much difference.
See https://01.org/linuxgraphics/gfx-docs/drm/admin-guide/pm/sle... for more information.
1. Laptop that can sleep for a week or ten days, and you’re going on holiday for a fortnight and leaving your laptop behind, and don’t want to leave it plugged in unattended (fire hazard) but don’t want to lose your session.
2. You’re off-grid for days on end (e.g. cycling tour with mostly tent camping, which I’ve done several times), and want to be able to use your laptop occasionally without its battery having been drained by being asleep instead of off, and want to keep using the same session.
3. You’re using a device with no battery (desktop computer or laptop with dud battery so that it dies as soon as you unplug it), but you need to move it from point A to point B without losing your session.
These are all straightforward examples where hibernate is essential.
Or pipe in /dev/urandom for that matter
if(data->guard != 0) {
// Hibernation happens here.
process(&data);
}Edit: I think something similar is used to avoid time related system calls, the values are just mapped into the application address space and the kernel updates time and guard values concurrent to the application.
Windows has been working on similar tech via Protected Processes[0], notably used for both LSASS and their new eBPF verifier. That's been a tricky technology to get right but I think it's interesting.
> Andy Lutomirski repeatedly opposed making uncached mappings available, objecting to the performance cost and more;
Interesting. I'll want to read more into this.
My guess is that for the next 5 years there will be endless ways to leak these secrets and maybe, if we're lucky, things will improve over that time.
Based on that, I doubt they ignored the problem of swap space. My guess is that the region of memory is designated unswappable, as was already possible before.
Or even, disable this when hibernating to a swap inside an encrypted luks partition (which also asks for a password when it wakes up)
Then you could do the operations involving the secret in a dedicated subprocess.