hibernation_available() checks for active secretmem users, but a secretmem file can be created after this check and its pages may get into the hibernation snapshot although they should not. Recheck that hibernation_available() after userspace is frozen and abort hibernation if it is not. Signed-off-by: Mike Rapoport (Microsoft) --- kernel/power/hibernate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index d2479c69d71a..97de677e360f 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -412,6 +412,11 @@ int hibernation_snapshot(int platform_mode) if (error) goto Close; + if (!hibernation_available()) { + error = -EBUSY; + goto Thaw; + } + if (hibernation_test(TEST_FREEZER)) { /* -- 2.53.0