🇰🇷 한글 설명
리눅스 커널의 tracing 기능에서 두 개 이상의 모듈이 동시에 로드될 때, trace event 목록을 추가하는 과정에서 경합 조건이 발생할 수 있습니다. 이로 인해 커널의 printk 포맷 문자열 수정 과정에서 목록 탐색이 손상되어 커널 패닉(Crash)이 발생할 수 있는 취약점입니다.
💡 쉬운 설명
여러 개의 시스템 부품(모듈)이 동시에 설치될 때, 기록 장치가 데이터를 정리하는 순서가 꼬여서 컴퓨터 시스템이 갑자기 멈추거나 꺼질 수 있는 문제입니다. 이를 방지하기 위해 데이터를 기록할 때 한 번에 하나씩만 처리하도록 잠금 장치를 추가했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing: Add down_write(trace_event_sem) when adding trace event
When a module is loaded, it adds trace events defined by the module. It
may also need to modify the modules trace printk formats to replace enum
names with their values.
If two modules are loaded at the same time, the adding of the event to the
ftrace_events list can corrupt the walking of the list in the code that is
modifying the printk format strings and crash the kernel.
The addition of the event should take the trace_event_sem for write while
it adds the new event.
Also add a lockdep_assert_held() on that semaphore in
__trace_add_event_dirs() as it iterates the list.
📍 영향받는 시스템
Linux Kernel (tracing 기능이 활성화된 버전)
⚔️ 공격 벡터
동시에 여러 커널 모듈을 로드하여 race condition을 유발함으로써 커널 크래시 유도
🛡️ 대응 방법
trace_event_sem 세마포어를 사용하여 쓰기 잠금을 적용한 최신 리눅스 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인