🇰🇷 한글 설명
Linux 커널의 drm/xe 드라이버에서 madvise IOCTL을 통해 조작된 pat_index 값을 전달할 경우, 경계 검사 없이 배열에 접근하여 커널 메모리를 읽을 수 있는 Out-of-Bounds(OOB) 취약점이 존재합니다. 이로 인해 공격자는 커널 메모리의 임의 데이터를 읽어낼 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제(커널)가 잘못된 번호표를 받았을 때, 허용되지 않은 메모리 영역을 들여다볼 수 있는 보안 구멍이 발견되었습니다. 나쁜 사용자가 이 구멍을 이용해 시스템 내부의 중요한 정보를 몰래 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/xe: Add bounds check on pat_index to prevent OOB kernel read in madvise
When user provides a bogus pat_index value through the madvise IOCTL, the
xe_pat_index_get_coh_mode() function performs an array access without
validating bounds. This allows a malicious user to trigger an out-of-bounds
kernel read from the xe->pat.table array.
The vulnerability exists because the validation in madvise_args_are_sane()
directly calls xe_pat_index_get_coh_mode(xe, args->pat_index.val) without
first checking if pat_index is within [0, xe->pat.n_entries).
Although xe_pat_index_get_coh_mode() has a WARN_ON to catch this in debug
builds, it still performs the unsafe array access in production kernels.
v2(Matthew Auld)
- Using array_index_nospec() to mitigate spectre attacks when the value
is used
v3(Matthew Auld)
- Put the declarations at the start of the block
(cherry picked from commit 944a3329b05510d55c69c2ef455136e2fc02de29)
📍 영향받는 시스템
Linux kernel (drm/xe driver component)
⚔️ 공격 벡터
사용자가 madvise IOCTL을 통해 유효하지 않은 pat_index 값을 전달하여 커널 메모리 읽기 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 pat_index 경계 검사 로직 적용
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인