From: Josh Boyer Date: Fri, 20 Jun 2014 12:53:24 +0000 (-0400) Subject: hibernate: Disable when securelevel is set X-Git-Tag: archive/raspbian/4.9.82-1+deb9u3+rpi1_jessie~10^2~37 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e9dac2438af9887597c05e58e6368ab5e263f972;p=linux-4.9.git hibernate: Disable when securelevel is set 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 Gbp-Pq: Topic features/all/securelevel Gbp-Pq: Name hibernate-disable-when-securelevel-is-set.patch --- diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index b26dbc48c75b..1bbf952f586f 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #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)); } /**