🇰🇷 한글 설명
리눅스 커널의 tracing 기능 중 glob 매칭 과정에서 경계 검사 미흡으로 인한 Out-of-bounds read 취약점이 발견되었습니다. 특정 문자열 필드가 NUL 종료 문자를 포함하지 않을 경우, glob_match 함수가 필드 범위를 벗어나 메모리를 읽어 KASAN slab-out-of-bounds read를 유발할 수 있습니다.
💡 쉬운 설명
리눅스 시스템의 기록(tracing) 기능이 특정 데이터를 읽을 때 데이터의 끝을 제대로 확인하지 못해, 허용되지 않은 메모리 영역까지 읽어버리는 문제입니다. 이로 인해 시스템 정보가 유출되거나 예기치 않은 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing: Prevent out-of-bounds read in glob matching
String event fields are not necessarily NUL-terminated, so the filter
predicate functions (filter_pred_string(), filter_pred_strloc() and
filter_pred_strrelloc()) pass the field length to the regex match
callbacks, and the length-aware matchers honour it.
regex_match_glob() was the exception: it ignored the length and called
glob_match(), which scans the string until it hits a NUL byte. Some
string fields are not NUL-terminated. One example is the dynamic char
array of the xfs_* namespace tracepoints, which is copied without a
trailing NUL. For such a field, glob matching reads past the end of
the event field, causing a KASAN slab-out-of-bounds read in
glob_match(), reached via regex_match_glob() and filter_match_preds()
from the xfs_lookup tracepoint.
Add a length-bounded glob_match_len() and use it from regex_match_glob()
so glob matching always stops at the field boundary. The matching loop
is factored into a shared helper so glob_match() keeps its behaviour.
📍 영향받는 시스템
NUL 종료 문자가 없는 문자열 필드를 사용하는 리눅스 커널 (예: xfs_* 네임스페이스 tracepoints 포함 버전)
⚔️ 공격 벡터
특정 tracepoint(예: xfs_lookup)를 통해 NUL 종료 문자가 없는 문자열 필드에 glob 패턴 매칭을 시도하여 메모리 경계를 넘어서 읽기 수행
🛡️ 대응 방법
길이 제한이 적용된 glob_match_len() 함수를 사용하는 최신 리눅스 커널로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.