🇰🇷 한글 설명
Linux 커널의 arm64 아키텍처에서 하이버네이션(최대 절전 모드) 복구 시 DAIF 예외 마스킹이 제대로 이루어지지 않는 취약점입니다. 이로 인해 복구 과정 중 예기치 않은 예외가 발생하여 시스템 충돌이나 경고가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터를 절전 모드에서 깨울 때, 시스템이 불안정한 상태에서 갑작스러운 오류가 발생하여 컴퓨터가 멈추거나 꺼질 수 있는 문제입니다. 시스템이 완전히 깨어나기 전까지 중요한 오류 신호를 잠시 차단해야 하는데 이 과정이 누락되었습니다.
🇺🇸 원문 (English)
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.
(2) When re-entering the resumed kernel, some DAIF bits will be clear
unexpectedly. This permits Debug, SError, or pseudo-NMI exceptions
to be taken for a short period while the resumed kernel is not yet
in a consistent state.
This is detected by CONFIG_ARM64_DEBUG_PRIORITY_MASKING.
Avoid these issues by masking all DAIF exceptions during resume.
📍 영향받는 시스템
Linux kernel (arm64 architecture) using hibernation/swsusp
⚔️ 공격 벡터
물리적 접근 또는 시스템 제어를 통한 하이버네이션(최대 절전 모드) 진입 및 복구 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 arm64 hibernate 관련 수정 사항을 반영해야 합니다.
🔧 검증 코드
커널 버전과 함께 CONFIG_ARM64_DEBUG_PRIORITY_MASKING 설정이 활성화되어 있는지 확인하여 패치 적용 여부를 판단합니다.
uname -a && grep -i 'CONFIG_ARM64_DEBUG_PRIORITY_MASKING' /boot/config-$(uname -r) 2>/dev/null