🇰🇷 한글 설명
리눅스 커널의 모듈 로더가 ELF 섹션 인덱스의 범위를 확인하지 않아 발생하는 취약점입니다. 잘못된 st_shndx 값이 입력될 경우 커널 패닉이 발생하여 시스템이 중단될 수 있습니다.
💡 쉬운 설명
리눅스 운영체제가 새로운 프로그램을 불러올 때, 잘못된 위치 정보를 참조하여 시스템이 갑자기 멈추거나 꺼질 수 있는 문제입니다. 이는 잘못된 데이터가 입력되었을 때 이를 검사하는 과정이 누락되어 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
module: Fix kernel panic when a symbol st_shndx is out of bounds
The module loader doesn't check for bounds of the ELF section index in
simplify_symbols():
for (i = 1; i < symsec->sh_size / sizeof(Elf_Sym); i++) {
const char *name = info->strtab + sym[i].st_name;
switch (sym[i].st_shndx) {
case SHN_COMMON:
[...]
default:
/* Divert to percpu allocation if a percpu var. */
if (sym[i].st_shndx == info->index.pcpu)
secbase = (unsigned long)mod_percpu(mod);
else
/** HERE --> **/ secbase = info->sechdrs[sym[i].st_shndx].sh_addr;
sym[i].st_value += secbase;
break;
}
}
A symbol with an out-of-bounds st_shndx value, for example 0xffff
(known as SHN_XINDEX or SHN_HIRESERVE), may cause a kernel panic:
BUG: unable to handle page fault for address: ...
RIP: 0010:simplify_symbols+0x2b2/0x480
...
Kernel panic - not syncing: Fatal exception
This can happen when module ELF is legitimately using SHN_XINDEX or
when it is corrupted.
Add a bounds check in simplify_symbols() to validate that st_shndx is
within the valid range before using it.
This issue was discovered due to a bug in llvm-objcopy, see relevant
discussion for details [1].
[1] https://lore.kernel.org/linux-modules/
[email protected]/
📍 영향받는 시스템
Linux Kernel (module loader component)
⚔️ 공격 벡터
조작되거나 손상된 ELF 모듈을 로드하여 커널 패닉 유도
🛡️ 대응 방법
커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 simplify_symbols() 함수의 경계 검사 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.