🇰🇷 한글 설명
Linux 커널의 media: iris 드라이버에서 MBPF(Macro Blocks Per Frame) 체크 중 fmt_src 객체에 대한 Use-After-Free 취약점이 발견되었습니다. 인스턴스가 코어 리스트에 남아있는 상태에서 다른 스레드가 fmt_src를 해제할 수 있어, MBPF 체크 과정에서 허공을 가리키는 포인터를 참조하게 됩니다.
💡 쉬운 설명
컴퓨터가 어떤 정보를 확인하려고 할 때, 이미 삭제되어 사라진 정보를 다시 읽으려고 시도하면서 발생하는 오류입니다. 이로 인해 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
media: iris: fix use-after-free of fmt_src during MBPF check
During concurrency testing, multiple instances can run in parallel, and
each instance uses its own inst->lock while the core->lock protects the
list of active instances. The race happens because these locks cover
different scopes, inst->lock protects only the internals of a single
instance, while the Macro Blocks Per Frame (MBPF) checker walks the
core list under core->lock and reads fields like fmt_src->width and
fmt_src->height. At the same time, iris_close() may free fmt_src and
fmt_dst under inst->lock while the instance is still present in the core
list. This allows a situation where the MBPF checker, still iterating
through the core list, reaches an instance whose fmt_src was already
freed by another thread and ends up dereferencing a dangling pointer,
resulting in a use-after-free. This happens because the MBPF checker
assumes that any instance in the core list is fully valid, but the
freeing of fmt_src and fmt_dst without removing the instance from the
core list is not correct.
The correct ordering is to defer freeing fmt_src and fmt_dst until after
the instance has been removed from the core list and all teardown under
the core lock has completed, ensuring that no dangling pointers are ever
exposed during MBPF checks.
📍 영향받는 시스템
Linux kernel (media: iris driver 포함 버전)
⚔️ 공격 벡터
병렬 처리가 발생하는 환경에서 특정 타이밍에 인스턴스 해제를 유도하여 메모리 오류를 일으키는 레이스 컨디션 공격
🛡️ 대응 방법
커널 패치를 적용하여 인스턴스가 코어 리스트에서 완전히 제거된 후 메모리가 해제되도록 수정해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.