(Now having some regret that I started two threads :P it seemed logical at the time.) https://lore.kernel.org/linux-mm/20191226220205.128664-2-semenzato@xxxxxxxxxx/ Wow. Let's say someone implements paging out anything above 50% RAM usage to swap. Let's further say someone implements signed hibernation images to support UEFI Secure Boot. Why couldn't an attacker target the unsigned swap contents? >The reason, at least what I found out, is that the kernel first copies the whole memory into your memory (ouch), before writing it to the swap partition. So if you have 16 GB RAM, you can't hibernate if you use more than 8 GB, and therefore an 8 GB swap partition (fully unoccupied) is enough for you. I have tested this multiple times, it works for me exactly as written. So, actually, a swap device sized 1:1 with RAM is already an overkill (unless you use more than 50% of swap size with just regular usage), and 0.5:1 ratio would be perfectly fine if you made sure that swap got used just for hibernation. Where I came up with 2:1 is from anaconda/blivet code: anaconda/pyanaconda/storage/utils.py:642: :param bool hibernation: calculate swap size big enough for hibernation https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/storage/utils.py#L654 Note on line 673 it actually could be 3x RAM, if --hibernation were used, but this flag isn't used on Fedora Workstation so this computation never gets used. And yet there is a 'resume=UUID' boot parameter included. Why is this boot parameter set as if we're supporting hibernation out of the box? -- Chris Murphy _______________________________________________ desktop mailing list -- desktop@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to desktop-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/desktop@xxxxxxxxxxxxxxxxxxxxxxx