🇰🇷 한글 설명
Linux 커널의 LoongArch 아키텍처에서 kexec 명령줄 마커를 검색할 때 주소 공간 불일치 문제가 발생합니다. kexec_load 경로에서 사용자 공간 버퍼를 잘못된 캐스팅을 통해 커널 컨텍스트에서 직접 참조함으로써 발생하며, 이를 copy_from_user()를 사용하여 안전하게 복사하도록 수정되었습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제(커널)가 사용자가 제공한 데이터를 검증 없이 직접 읽으려다 발생하는 보안 결함입니다. 이로 인해 시스템이 불안정해지거나 보안 규칙을 우회할 위험이 있어, 데이터를 안전한 영역으로 먼저 복사하도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
LoongArch: Fix address space mismatch in kexec command line lookup
When searching the loaded segments for the "kexec" command line marker,
the kexec_load(2) path (file_mode == 0) passes the user-space segment
buffer straight to strncmp() through a bogus (char __user *) cast. This
dereferences a user pointer in kernel context, which is wrong and is
flagged by sparse:
arch/loongarch/kernel/machine_kexec.c:84:51: sparse: incorrect type in
argument 2 (different address spaces) @@ expected char const * @@ got
char [noderef] __user *
Here copy the marker-sized prefix of each segment into a small on-stack
buffer with copy_from_user() before comparing, and skip segments that
fault. The subsequent copy_from_user() that stages the full command line
into the safe area is left unchanged.
📍 영향받는 시스템
LoongArch 아키텍처를 사용하는 Linux 커널 버전
⚔️ 공격 벡터
악의적인 사용자 공간 포인터를 전달하여 커널이 잘못된 메모리 주소를 참조하도록 유도
🛡️ 대응 방법
LoongArch 관련 kexec 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인