arm64: hibernate: Restore DAIF state on error
authorVladimir Murzin <vladimir.murzin@arm.com>
Mon, 27 Jul 2026 16:34:12 +0000 (17:34 +0100)
committerWill Deacon <will@kernel.org>
Thu, 6 Aug 2026 13:07:45 +0000 (13:07 +0000)
Sashiko AI has reported that if swsusp_mte_save_tags() for some reason
fails we return from swsusp_arch_suspend() with DAIF being masked -
that is not what we'd expect. Restore the saved DAIF state before
returning from the error path.

Fixes: ee11f332af96 ("arm64: mte: Save tags when hibernating")
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/hibernate.c

index 1eb1c10..7bf1174 100644 (file)
@@ -348,8 +348,10 @@ int swsusp_arch_suspend(void)
                crash_prepare_suspend();
 
                ret = swsusp_mte_save_tags();
-               if (ret)
+               if (ret) {
+                       local_daif_restore(flags);
                        return ret;
+               }
 
                sleep_cpu = smp_processor_id();
                ret = swsusp_save();