🇰🇷 한글 설명
리눅스 커널의 perf 서브시스템에서 perf_pending_task() 함수가 이벤트가 해제된 후 실행되는 Use-After-Free(UaF) 취약점이 발견되었습니다. 이는 task_work가 큐에 등록된 상태에서 이벤트가 파괴되거나, 이벤트 파괴 과정에서 task_work가 큐에 등록될 때 발생합니다.
💡 쉬운 설명
컴퓨터의 성능을 측정하는 기능에서 이미 삭제된 데이터를 다시 사용하려고 시도하는 오류가 있습니다. 이 오류를 이용하면 해커가 시스템을 망가뜨리거나 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf: Fix perf_pending_task() UaF
Per syzbot it is possible for perf_pending_task() to run after the
event is free()'d. There are two related but distinct cases:
- the task_work was already queued before destroying the event;
- destroying the event itself queues the task_work.
The first cannot be solved using task_work_cancel() since
perf_release() itself might be called from a task_work (____fput),
which means the current->task_works list is already empty and
task_work_cancel() won't be able to find the perf_pending_task()
entry.
The simplest alternative is extending the perf_event lifetime to cover
the task_work.
The second is just silly, queueing a task_work while you know the
event is going away makes no sense and is easily avoided by
re-arranging how the event is marked STATE_DEAD and ensuring it goes
through STATE_OFF on the way down.
📍 영향받는 시스템
perf 서브시스템을 사용하는 리눅스 커널 버전
⚔️ 공격 벡터
특정 조건에서 perf 이벤트를 생성하고 해제하는 과정을 조작하여 메모리 오류 유도
🛡️ 대응 방법
perf 이벤트의 수명 주기를 관리하도록 수정된 최신 리눅스 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인