🇰🇷 한글 설명
Linux 커널의 IPC 조회 함수(idr_for_each)가 RCU 보호 없이 호출되어 발생하는 use-after-free 취약점입니다. shm_destroy_orphaned() 함수에서 이미 해제된 radix_tree_node 메모리에 접근 가능하며, RCU 읽기 임계 영역으로 보호하지 않아 발생합니다.
💡 쉬운 설명
리눅스 커널의 공유 메모리 시스템에서 이미 삭제된 메모리를 실수로 접근하는 버그입니다. 로컬 공격자가 이를 악용하면 시스템 충돌이나 권한 상승이 가능합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ipc: fix to protect IPCS lookups using RCU
syzbot reported that it discovered a use-after-free vulnerability, [0]
[0]: https://lore.kernel.org/all/
[email protected]/
idr_for_each() is protected by rwsem, but this is not enough. If it is
not protected by RCU read-critical region, when idr_for_each() calls
radix_tree_node_free() through call_rcu() to free the radix_tree_node
structure, the node will be freed immediately, and when reading the next
node in radix_tree_for_each_slot(), the already freed memory may be read.
Therefore, we need to add code to make sure that idr_for_each() is
protected within the RCU read-critical region when we call it in
shm_destroy_orphaned().
📍 영향받는 시스템
Linux kernel 모든 버전 (패치 전), 특히 공유 메모리(shm) 기능을 사용하는 모든 Linux 시스템
⚔️ 공격 벡터
로컬 공격자가 IPC 시스템에 특정 시퀀스로 접근하여 use-after-free 조건을 트리거
🛡️ 대응 방법
Linux 커널을 최신 패치 버전으로 업그레이드하거나 상류 커널의 RCU 보호 패치 적용
🔧 검증 코드
커널 버전이 배포판의 패치 권고 버전 이상이면 안전하고, 이하면 취약합니다. 각 배포판(Ubuntu, CentOS 등)의 공식 보안 권고에서 패치 버전 확인 필요
uname -r | grep -oE '[0-9]+\.[0-9]+' && cat /proc/version | grep -oE 'version [^ ]+'