🇰🇷 한글 설명
Linux 커널의 tracing/osnoise 구성 요소에서 slab-out-of-bounds 취약점이 발견되었습니다. osnoise_cpus_write 함수가 write() 시스템 콜을 통해 CPU 목록을 설정할 때, 입력 버퍼의 끝에 널(NULL) 문자가 없어 메모리 경계를 벗어나는 읽기 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스에서 특정 설정을 바꿀 때, 데이터의 끝을 알리는 표시가 없어 메모리의 잘못된 부분을 읽어버리는 문제입니다. 이로 인해 시스템이 불안정해지거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing/osnoise: Fix slab-out-of-bounds in _parse_integer_limit()
When config osnoise cpus by write() syscall, the following KASAN splat may
be observed:
BUG: KASAN: slab-out-of-bounds in _parse_integer_limit+0x103/0x130
Read of size 1 at addr ffff88810121e3a1 by task test/447
CPU: 1 UID: 0 PID: 447 Comm: test Not tainted 6.17.0-rc6-dirty #288 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x55/0x70
print_report+0xcb/0x610
kasan_report+0xb8/0xf0
_parse_integer_limit+0x103/0x130
bitmap_parselist+0x16d/0x6f0
osnoise_cpus_write+0x116/0x2d0
vfs_write+0x21e/0xcc0
ksys_write+0xee/0x1c0
do_syscall_64+0xa8/0x2a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
</TASK>
This issue can be reproduced by below code:
const char *cpulist = "1";
int fd=open("/sys/kernel/debug/tracing/osnoise/cpus", O_WRONLY);
write(fd, cpulist, strlen(cpulist));
Function bitmap_parselist() was called to parse cpulist, it require that
the parameter 'buf' must be terminated with a '\0' or '\n'. Fix this issue
by adding a '\0' to 'buf' in osnoise_cpus_write().
📍 영향받는 시스템
Linux kernel (osnoise 구성 요소가 활성화된 버전)
⚔️ 공격 벡터
로컬 사용자가 /sys/kernel/debug/tracing/osnoise/cpus 파일에 적절히 종료되지 않은 문자열을 write() 시스템 콜로 작성하여 공격
🛡️ 대응 방법
osnoise_cpus_write() 함수 내에서 입력 버퍼 끝에 널(NULL) 문자를 추가하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인합니다.