🇰🇷 한글 설명
리눅스 커널의 tracing 기능 중 합성 이벤트(synthetic events)에서 문자열을 읽을 때 메모리 유효성 검사를 수행하지 않는 취약점입니다. 공격자가 유효하지 않은 사용자 공간 주소를 전달할 경우 strlen() 또는 strscpy() 함수 호출 과정에서 커널 패닉(Oops)이 발생하여 시스템이 충돌할 수 있습니다.
💡 쉬운 설명
리눅스 시스템의 기록 기능이 잘못된 메모리 주소를 읽으려고 시도하여 컴퓨터가 갑자기 멈추거나 꺼질 수 있는 문제입니다. 공격자가 특수한 명령을 보내 시스템을 강제로 다운시킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix reading strings from synthetic events
The follow commands caused a crash:
# cd /sys/kernel/tracing
# echo 's:open char file[]' > dynamic_events
# echo 'hist:keys=common_pid:file=filename:onchange($file).trace(open,$file)' > events/syscalls/sys_enter_openat/trigger'
# echo 1 > events/synthetic/open/enable
BOOM!
The problem is that the synthetic event field "char file[]" will read
the value given to it as a string without any memory checks to make sure
the address is valid. The above example will pass in the user space
address and the sythetic event code will happily call strlen() on it
and then strscpy() where either one will cause an oops when accessing
user space addresses.
Use the helper functions from trace_kprobe and trace_eprobe that can
read strings safely (and actually succeed when the address is from user
space and the memory is mapped in).
Now the above can show:
packagekitd-1721 [000] ...2. 104.597170: open: file=/usr/lib/rpm/fileattrs/cmake.attr
in:imjournal-978 [006] ...2. 104.599642: open: file=/var/lib/rsyslog/imjournal.state.tmp
packagekitd-1721 [000] ...2. 104.626308: open: file=/usr/lib/rpm/fileattrs/debuginfo.attr
📍 영향받는 시스템
Linux Kernel (tracing/synthetic events 기능이 활성화된 버전)
⚔️ 공격 벡터
사용자 공간의 잘못된 메모리 주소를 합성 이벤트의 문자열 필드로 전달하여 커널 오류 유도
🛡️ 대응 방법
커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 trace_kprobe/eprobe의 안전한 문자열 읽기 함수를 사용하도록 수정
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 최신 패치 버전인지 확인