🇰🇷 한글 설명
Linux 커널의 Xen privcmd 드라이버에서 privcmd_ioctl_dm_op() 함수의 오류 처리 경로가 잘못되어 있습니다. 페이지가 NULL인 상태에서 unlock_pages()를 호출해 NULL 역참조가 발생할 수 있으며, pin_user_pages_fast()가 요청한 페이지를 모두 고정하지 못했는지 확인하지 않아 간헐적 실패가 생길 수 있습니다. 수정은 실제 고정된 페이지 수로 unlock을 수행하고 고정 개수를 검증하는 방식입니다.
💡 쉬운 설명
Xen 가상화 환경에서 특정 기능을 사용할 때 오류 처리가 잘못되어 시스템이 비정상 동작하거나 메모리 관리가 불안정해질 수 있습니다. 해당 커널 패치를 적용하면 이 문제가 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xen/privcmd: fix error exit of privcmd_ioctl_dm_op()
The error exit of privcmd_ioctl_dm_op() is calling unlock_pages()
potentially with pages being NULL, leading to a NULL dereference.
Additionally lock_pages() doesn't check for pin_user_pages_fast()
having been completely successful, resulting in potentially not
locking all pages into memory. This could result in sporadic failures
when using the related memory in user mode.
Fix all of that by calling unlock_pages() always with the real number
of pinned pages, which will be zero in case pages being NULL, and by
checking the number of pages pinned by pin_user_pages_fast() matching
the expected number of pages.
📍 영향받는 시스템
Xen 하이퍼바이저를 사용하는 Linux 커널(패치 이전 버전, Xen privcmd 드라이버 포함 환경)
⚔️ 공격 벡터
로컬 권한을 가진 사용자가 privcmd 디바이스를 통해 dm_op 호출을 반복해 NULL 역참조 또는 메모리 고정 불일치를 유발할 수 있음
🛡️ 대응 방법
배포판 제공 최신 커널 업데이트를 적용하거나 커널 소스에 해당 upstream 수정 커밋을 반영 후 재부팅
🔧 검증 코드
커널 버전이 패치된 배포판 업데이트 버전 이상인지 확인하고, CONFIG_XEN_PRIVCMD=y 또는 =m이면 해당 드라이버가 빌드되어 있으므로 패치 적용 여부를 점검해야 합니다. 설정이 없으면 영향을 받지 않습니다.
uname -r; grep -E 'CONFIG_XEN_PRIVCMD' /boot/config-$(uname -r) 2>/dev/null