hibernate: Disable when securelevel is set
authorJosh Boyer <jwboyer@fedoraproject.org>
Fri, 20 Jun 2014 12:53:24 +0000 (08:53 -0400)
committerYves-Alexis Perez <corsac@debian.org>
Wed, 21 Feb 2018 15:29:03 +0000 (15:29 +0000)
There is currently no way to verify the resume image when returning
from hibernate.  This might compromise the securelevel trust model,
so until we can work with signed hibernate images we disable it in
a secure modules environment.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name hibernate-disable-when-securelevel-is-set.patch

kernel/power/hibernate.c

index b26dbc48c75b9fa9045fafeccde8b23e69b9ab2e..1bbf952f586f62786cade4182aca02341fa27b18 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/ctype.h>
 #include <linux/genhd.h>
 #include <linux/ktime.h>
+#include <linux/security.h>
 #include <trace/events/power.h>
 
 #include "power.h"
@@ -67,7 +68,7 @@ static const struct platform_hibernation_ops *hibernation_ops;
 
 bool hibernation_available(void)
 {
-       return (nohibernate == 0);
+       return ((nohibernate == 0) && (get_securelevel() <= 0));
 }
 
 /**