🇰🇷 한글 설명
Linux 커널의 binder 구성 요소에서 binder_add_freeze_work() 함수 실행 중 경합 조건(Race Condition)으로 인해 발생하는 Out-of-Bounds(OOB) 취약점입니다. proc->nodes를 순회하는 동안 락(lock)이 일시적으로 해제되어, 노드가 삭제되는 과정에서 잘못된 메모리 주소에 접근하게 됩니다.
💡 쉬운 설명
시스템이 작업을 처리하는 도중 데이터가 갑자기 삭제되면서, 컴퓨터가 엉뚱한 메모리 위치를 읽으려다 오류가 발생하는 문제입니다. 이로 인해 시스템이 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
binder: fix OOB in binder_add_freeze_work()
In binder_add_freeze_work() we iterate over the proc->nodes with the
proc->inner_lock held. However, this lock is temporarily dropped to
acquire the node->lock first (lock nesting order). This can race with
binder_deferred_release() which removes the nodes from the proc->nodes
rbtree and adds them into binder_dead_nodes list. This leads to a broken
iteration in binder_add_freeze_work() as rb_next() will use data from
binder_dead_nodes, triggering an out-of-bounds access:
==================================================================
BUG: KASAN: global-out-of-bounds in rb_next+0xfc/0x124
Read of size 8 at addr ffffcb84285f7170 by task freeze/660
CPU: 8 UID: 0 PID: 660 Comm: freeze Not tainted 6.11.0-07343-ga727812a8d45 #18
Hardware name: linux,dummy-virt (DT)
Call trace:
rb_next+0xfc/0x124
binder_add_freeze_work+0x344/0x534
binder_ioctl+0x1e70/0x25ac
__arm64_sys_ioctl+0x124/0x190
The buggy address belongs to the variable:
binder_dead_nodes+0x10/0x40
[...]
==================================================================
This is possible because proc->nodes (rbtree) and binder_dead_nodes
(list) share entries in binder_node through a union:
struct binder_node {
[...]
union {
struct rb_node rb_node;
struct hlist_node dead_node;
};
Fix the race by checking that the proc is still alive. If not, simply
break out of the iteration.
📍 영향받는 시스템
Linux kernel (binder driver 사용 시스템)
⚔️ 공격 벡터
특정 ioctl 호출을 통해 binder 노드 삭제와 freeze 작업 사이의 타이밍을 조작하는 경합 조건 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 binder_add_freeze_work()의 로직 수정 적용
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인