🇰🇷 한글 설명
Linux 커널의 debugobjects 구성 요소에서 메모리 부족(OOM) 상황과 동시에 발생하는 레이스 컨디션 취약점입니다. 메모리 부족으로 인해 디버그 객체가 비활성화되었음에도 불구하고, 특정 조건에서 수정 콜백 함수가 무조건 호출되어 타이머가 정상적으로 작동하지 않는 문제가 발생합니다.
💡 쉬운 설명
컴퓨터 메모리가 부족해져서 디버깅 기능을 끄는 도중에, 시스템이 실수로 꺼진 기능을 계속 실행하려고 시도하여 타이머 기능이 고장 나는 문제입니다. 이로 인해 시스템의 시간 관리 기능에 오류가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
debugobjects: Plug race against a concurrent OOM disable
syzbot reported a puzzling splat:
WARNING: kernel/time/hrtimer.c:443 at stub_timer+0xa/0x20
stub_timer() is installed as timer callback function in
hrtimer_fixup_assert_init(), which is invoked when
debug_object_assert_init() can't find a shadow object. In that case debug
objects emits a warning about it before invoking the fixup.
Though the provided console log lacks this warning and instead has the
following a few seconds before the splat:
ODEBUG: Out of memory. ODEBUG disabled
So the object was looked up in debug_object_assert_init() and the lookup
failed due a concurrent out of memory situation which disabled debug
objects and freed the shadow objects:
debug_object_assert_init()
if (!debug_objects_enabled)
return; obj = alloc();
if (!obj) {
// Out of memory
debug_objects_enabled = false;
free_objects();
obj = lookup_or_alloc();
// The lookup failed because the other side
// removed the objects, so this returns
// an error code as the object in question
// is not statically initialized
if (!IS_ERR_OR_NULL(obj))
return;
if (!obj) {
debug_oom();
return;
}
print(...)
if (!debug_objects_enabled)
return;
fixup(...)
The debug object splat is skipped because debug_objects_enabled is false,
but the fixup callback is invoked unconditionally, which makes the timer
disfunctional.
This is only a problem in debug_object_assert_init() and
debug_object_activate() as both have to handle statically initialized
objects and therefore must handle the error pointer return case
gracefully. All other places only handle the found/not found case and the
NULL pointer return is a signal for OOM. Otherwise they get a valid shadow
object.
Plug the hole by checking whether debug objects are still enabled before
invoking the print and fixup function in those two places.
📍 영향받는 시스템
Linux Kernel (debugobjects 기능이 활성화된 버전)
⚔️ 공격 벡터
메모리 부족(OOM) 상황을 유도하여 디버그 객체 비활성화와 타이머 콜백 호출 간의 레이스 컨디션을 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 debug_objects_enabled 상태를 확인하도록 수정된 코드를 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.