🇰🇷 한글 설명
Linux 커널의 rust_binder 구성 요소에서 오프셋 배열 정리 시 u64 대신 usize를 사용하여 발생하는 참조 횟수 오류 취약점입니다. 32비트 커널 환경에서 배열을 잘못된 간격으로 순회하여 참조 횟수를 과도하게 감소시킴으로써 Binder의 참조 계정 시스템을 손상시킵니다.
💡 쉬운 설명
컴퓨터가 메모리를 정리할 때 숫자를 잘못 읽어서, 아직 사용 중인 데이터인데도 이미 다 썼다고 착각하여 삭제를 시도하는 문제입니다. 이로 인해 시스템이 불안정해지거나 데이터 관리 체계에 오류가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
rust_binder: use a u64 stride when cleaning up the offsets array
Allocation's Drop walks the offsets array (binder_size_t = u64 entries),
cleaning up the objects, but it used usize instead of u64 for both the
stride and the per-entry read.
On 64-bit kernels (usize == u64) this is harmless, but on 32-bit kernels
it walks the 8-byte entries in 4-byte steps, iterating an N-entry array
2N times, and reads the always-zero high word as offset 0, cleaning up
the object at offset 0 N extra times. As a result the referenced node or
handle ends up with a lower reference count than it actually has (a
refcount over-decrement), and binder's reference accounting is corrupted;
for example, the owner can be notified of a strong reference release
(BR_RELEASE) even though references still remain.
Change the stride to u64, and read each entry as a u64, narrowing it to
usize with try_into().
On 32-bit ARM, when this over-decrement would drive a count below zero,
the driver's existing refcount guard refuses it and fires:
rust_binder: Failure: refcount underflow!
📍 영향받는 시스템
Rust 기반 Binder를 사용하는 32비트 Linux 커널 시스템
⚔️ 공격 벡터
로컬 공격자가 Binder 인터페이스를 통해 참조 횟수 불일치를 유도하여 메모리 관리 오류 유발
🛡️ 대응 방법
커널 패치를 적용하여 rust_binder의 오프셋 배열 처리 로직을 u64 기반으로 수정
🔧 검증 코드
명령어 실행 결과에 'refcount underflow!' 메시지가 나타나면 해당 취약점이 발생했거나 발생했던 흔적이 있는 것입니다.
uname -a && dmesg | grep -i 'rust_binder: Failure: refcount underflow!'