arm64: hibernate: mask DAIF before restoring hibernated kernel
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 82869ac57b5d3b550446932c918dbf2caf020c9e · < 012823494e20c3cce622982ebd3fd6971be39ad2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
arm64: hibernate: mask DAIF before restoring hibernated kernel
The arm64 hibernate code manages the exception masking in an unsound way, leading to potential crashes and/or warnings during resume.
When a hibernation image is saved in `swsusp_arch_suspend()`, all DAIF exceptions are masked (by virtue of `local_daif_save()`), and the suspended image is saved assuming that all DAIF exceptions will remain masked when the image is restored.
When a hibernation image is resumed by `swsusp_arch_resume()`, only interrupts are masked (by virtue of `local_irq_disable()` in `resume_target_kernel()`). When pseudo-NMI is enabled the DAIF.IF bits will be clear, and regardless of pseudo-NMI the DAIF.DA bits will be clear.
This means that there are two problems:
(1) It is possible to take Debug, SError, or pseudo-NMI exceptions during the resume process. This is unsafe, as during the resume process both the old ane new kernels will tranisently be in an inconsistent state, and swsusp_arch_suspend_exit() won't retain an executable mapping of any exception vectors.
Any exception taken here will be fatal and silent.
From the CVE record · Linux
The Linux kernel's arm64 hibernation code does not mask all DAIF exceptions while restoring a hibernated kernel. An exception during resume can cause a fatal, silent crash; exceptions shortly after restoration can occur while the kernel is inconsistent. The input does not describe an attacker path, authentication requirement, or user interaction.
Engineers running the Linux kernel on arm64 systems that use hibernation should check their installations; affected versions are not specified.