🔍 CVE-2022-49219

5.5
CVSS Score
MEDIUM
2025-02-26
2026-11-05 20:17
✅ 완료

🇰🇷 한글 설명

Linux 커널의 vfio/pci 드라이버에서 D3hot에서 D0로 전환하는 과정 중 메모리 누수가 발생하는 문제가 수정되었습니다. 리셋 IOCTL 호출 시 저장된 PCI 상태 메모리가 해제되지 않아, 반복 호출 시 메모리 고갈(OOM)이 발생할 수 있었습니다. 패치는 덮어쓰기 전에 기존 할당 메모리를 먼저 해제합니다.

💡 쉬운 설명

가상 머신용 장치를 전원 절약 상태와 리셋 상태로 반복해서 전환하면 컴퓨터가 쓰지 않는 메모리를 계속 붙잡고 있는 문제가 있었습니다. 이로 인해 시스템 메모리가 모두 소진될 수 있었고, 이번 수정으로 이 문제가 해결되었습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: vfio/pci: fix memory leak during D3hot to D0 transition If 'vfio_pci_core_device::needs_pm_restore' is set (PCI device does not have No_Soft_Reset bit set in its PMCSR config register), then the current PCI state will be saved locally in 'vfio_pci_core_device::pm_save' during D0->D3hot transition and same will be restored back during D3hot->D0 transition. For saving the PCI state locally, pci_store_saved_state() is being used and the pci_load_and_free_saved_state() will free the allocated memory. But for reset related IOCTLs, vfio driver calls PCI reset-related API's which will internally change the PCI power state back to D0. So, when the guest resumes, then it will get the current state as D0 and it will skip the call to vfio_pci_set_power_state() for changing the power state to D0 explicitly. In this case, the memory pointed by 'pm_save' will never be freed. In a malicious sequence, the state changing to D3hot followed by VFIO_DEVICE_RESET/VFIO_DEVICE_PCI_HOT_RESET can be run in a loop and it can cause an OOM situation. This patch frees the earlier allocated memory first before overwriting 'pm_save' to prevent the mentioned memory leak.

📍 영향받는 시스템

Linux 커널 (vfio-pci 드라이버를 사용하는 버전, 수정 커밋 적용 전 커널)

⚔️ 공격 벡터

권한이 있는 가상 머신 사용자가 장치를 D3hot 상태로 전환한 뒤 VFIO_DEVICE_RESET 또는 VFIO_DEVICE_PCI_HOT_RESET을 반복 호출하여 메모리 고갈을 유발

🛡️ 대응 방법

커널을 해당 수정 패치가 포함된 최신 안정 버전으로 업데이트하고 재부팅

🔧 검증 코드

출력된 커널 버전이 패치가 포함된 배포판 최신 버전인지 확인하고, vfio 모듈이 로드되지 않았다면 이 취약점의 영향을 받지 않습니다.

Shell / Script
uname -r && (grep -i vfio /proc/modules 2>/dev/null || echo 'vfio 모듈 미로드')

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel