hibernate: Disable when the kernel is locked down
authorJosh Boyer <jwboyer@fedoraproject.org>
Wed, 8 Nov 2017 15:11:33 +0000 (15:11 +0000)
committerSalvatore Bonaccorso <carnil@debian.org>
Tue, 20 Mar 2018 08:31:07 +0000 (08:31 +0000)
There is currently no way to verify the resume image when returning
from hibernate.  This might compromise the signed modules trust model,
so until we can work with signed hibernate images we disable it when the
kernel is locked down.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: "Lee, Chun-Yi" <jlee@suse.com>
cc: linux-pm@vger.kernel.org

Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0009-hibernate-Disable-when-the-kernel-is-locked-down.patch

kernel/power/hibernate.c

index a5c36e9c56a670c59cabe20376f2ce1aedcd5e8a..f2eafefeec50bf9a735ad03507e68fa2e5b78bbc 100644 (file)
@@ -70,7 +70,7 @@ static const struct platform_hibernation_ops *hibernation_ops;
 
 bool hibernation_available(void)
 {
-       return (nohibernate == 0);
+       return nohibernate == 0 && !kernel_is_locked_down("Hibernation");
 }
 
 /**