🇰🇷 한글 설명
Linux 커널의 tracing_map에서 next_elt 변수가 오버플로우되어 최대 요소 수를 초과한 후에도 계속 요소를 삽입할 수 있는 취약점입니다. 이로 인해 tracing_map이 가득 찰 때 무한 루프가 발생하여 CPU가 멈추는 문제가 발생합니다.
💡 쉬운 설명
Linux 커널에서 추적 데이터를 저장하는 맵의 크기 제한이 제대로 적용되지 않아 과도한 데이터를 계속 추가할 수 있습니다. 이로 인해 시스템이 먹통이 되고 CPU가 응답하지 않게 됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix overflow in get_free_elt()
"tracing_map->next_elt" in get_free_elt() is at risk of overflowing.
Once it overflows, new elements can still be inserted into the tracing_map
even though the maximum number of elements (`max_elts`) has been reached.
Continuing to insert elements after the overflow could result in the
tracing_map containing "tracing_map->max_size" elements, leaving no empty
entries.
If any attempt is made to insert an element into a full tracing_map using
`__tracing_map_insert()`, it will cause an infinite loop with preemption
disabled, leading to a CPU hang problem.
Fix this by preventing any further increments to "tracing_map->next_elt"
once it reaches "tracing_map->max_elt".
📍 영향받는 시스템
Linux 커널 (영향받는 정확한 버전은 커널 빌드 설정에 따라 다름, 주로 5.10 이상의 kernel tracing 기능 사용 시스템)
⚔️ 공격 벡터
권한 있는 사용자가 tracing 기능에 접근하여 의도적으로 대량의 추적 요소를 생성해 overflow를 유발
🛡️ 대응 방법
Linux 커널을 최신 패치 버전으로 업데이트하여 tracing_map->next_elt의 증가를 제한하는 fix 적용
🔧 검증 코드
커널 버전과 CONFIG_TRACING 설정 여부를 확인하여 해당 커널이 tracing 기능을 가지고 있는지, 그리고 취약한 버전인지 판단합니다.
uname -r | grep -E '^[0-9]+\.[0-9]+' && cat /boot/config-$(uname -r) | grep CONFIG_TRACING