🇰🇷 한글 설명
Linux 커널의 perf/ftrace 구성 요소에서 ftrace_ops의 등록 여부를 확인하지 않고 해제 함수를 호출하여 발생하는 경고(WARNING) 취약점입니다. perf_event_alloc() 오류 처리 과정에서 이미 등록되지 않았거나 해제된 ftrace_ops를 다시 해제하려 할 때 WARN_ON이 트리거됩니다.
💡 쉬운 설명
프로그램이 작업을 정리하는 과정에서 이미 종료된 작업을 다시 종료하려고 시도하여 시스템에 경고 메시지를 남기는 문제입니다. 이는 시스템의 안정성을 해칠 수 있는 논리적 오류입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf/ftrace: Fix WARNING in __unregister_ftrace_function
perf_ftrace_function_unregister() unconditionally calls
unregister_ftrace_function() without checking whether the ftrace_ops
was ever successfully registered. This triggers a WARN_ON in
__unregister_ftrace_function() when the ops doesn't have
FTRACE_OPS_FL_ENABLED set.
This can happen during perf_event_alloc() error cleanup when
perf_trace_destroy() is called via __free_event() on an event whose
ftrace_ops registration failed or was already torn down by
perf_try_init_event()'s err_destroy path.
The call path is:
perf_event_alloc() error cleanup
-> __free_event()
-> event->destroy() [tp_perf_event_destroy]
-> perf_trace_destroy()
-> perf_trace_event_close()
-> TRACE_REG_PERF_CLOSE
-> perf_ftrace_function_unregister()
-> unregister_ftrace_function()
-> __unregister_ftrace_function()
-> WARN_ON(!(ops->flags & FTRACE_OPS_FL_ENABLED))
Fix this by checking FTRACE_OPS_FL_ENABLED before attempting to
unregister. If the ops is not enabled, just free the filter and
return success.
📍 영향받는 시스템
Linux Kernel (perf/ftrace 관련 모듈 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 특정 perf_event 할당 오류를 유도하여 커널 경고를 발생시킬 수 있음
🛡️ 대응 방법
커널 패치를 적용하여 unregister_ftrace_function 호출 전 FTRACE_OPS_FL_ENABLED 플래그를 확인하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전인지 배포판 보안 공지를 통해 확인