🇰🇷 한글 설명
Linux 커널의 drm/xe/migrate 구성 요소에서 무한 재귀가 발생하는 취약점이 발견되었습니다. 데이터 정렬이 맞지 않을 때 스택에 할당된 바운스 버퍼를 사용하는데, 이 버퍼마저 정렬되지 않으면 함수가 계속 재귀 호출되어 스택 오버플로와 커널 패닉을 유발합니다.
💡 쉬운 설명
데이터를 처리하는 과정에서 정렬 규칙이 맞지 않으면 컴퓨터가 똑같은 작업을 무한히 반복하게 됩니다. 이로 인해 시스템의 메모리가 가득 차서 컴퓨터가 갑자기 멈추거나 꺼질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/migrate: prevent infinite recursion
If the buf + offset is not aligned to XE_CAHELINE_BYTES we fallback to
using a bounce buffer. However the bounce buffer here is allocated on
the stack, and the only alignment requirement here is that it's
naturally aligned to u8, and not XE_CACHELINE_BYTES. If the bounce
buffer is also misaligned we then recurse back into the function again,
however the new bounce buffer might also not be aligned, and might never
be until we eventually blow through the stack, as we keep recursing.
Instead of using the stack use kmalloc, which should respect the
power-of-two alignment request here. Fixes a kernel panic when
triggering this path through eudebug.
v2 (Stuart):
- Add build bug check for power-of-two restriction
- s/EINVAL/ENOMEM/
(cherry picked from commit 38b34e928a08ba594c4bbf7118aa3aadacd62fff)
📍 영향받는 시스템
Linux kernel (drm/xe/migrate 모듈을 사용하는 시스템)
⚔️ 공격 벡터
정렬되지 않은 메모리 오프셋을 유도하여 커널의 특정 경로를 실행시키는 방식
🛡️ 대응 방법
커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 스택 대신 kmalloc을 사용하도록 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.