🔍 CVE-2022-49939

7.8
CVSS Score
HIGH
2025-06-18
2026-08-04 10:18
✅ 완료

🇰🇷 한글 설명

리눅스 커널의 Binder 드라이버에서 레이스 컨디션으로 인해 발생하는 Use-After-Free(UAF) 취약점입니다. BINDER_TYPE_WEAK_HANDLE 트랜잭션 실패 시 참조 카운트 관리가 제대로 이루어지지 않아, 프로세스가 종료되는 과정에서 dangling pointer가 생성되어 메모리 오류를 유발합니다.

💡 쉬운 설명

프로세스가 종료되는 순간과 데이터가 처리되는 순간이 겹치면서, 이미 사라진 메모리 주소를 다시 사용하려고 시도하여 시스템 오류가 발생하는 문제입니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: binder: fix UAF of ref->proc caused by race condition A transaction of type BINDER_TYPE_WEAK_HANDLE can fail to increment the reference for a node. In this case, the target proc normally releases the failed reference upon close as expected. However, if the target is dying in parallel the call will race with binder_deferred_release(), so the target could have released all of its references by now leaving the cleanup of the new failed reference unhandled. The transaction then ends and the target proc gets released making the ref->proc now a dangling pointer. Later on, ref->node is closed and we attempt to take spin_lock(&ref->proc->inner_lock), which leads to the use-after-free bug reported below. Let's fix this by cleaning up the failed reference on the spot instead of relying on the target to do so. ================================================================== BUG: KASAN: use-after-free in _raw_spin_lock+0xa8/0x150 Write of size 4 at addr ffff5ca207094238 by task kworker/1:0/590 CPU: 1 PID: 590 Comm: kworker/1:0 Not tainted 5.19.0-rc8 #10 Hardware name: linux,dummy-virt (DT) Workqueue: events binder_deferred_func Call trace: dump_backtrace.part.0+0x1d0/0x1e0 show_stack+0x18/0x70 dump_stack_lvl+0x68/0x84 print_report+0x2e4/0x61c kasan_report+0xa4/0x110 kasan_check_range+0xfc/0x1a4 __kasan_check_write+0x3c/0x50 _raw_spin_lock+0xa8/0x150 binder_deferred_func+0x5e0/0x9b0 process_one_work+0x38c/0x5f0 worker_thread+0x9c/0x694 kthread+0x188/0x190 ret_from_fork+0x10/0x20

📍 영향받는 시스템

Linux kernel (v5.19.0-rc8 및 관련 Binder 드라이버 사용 버전)

⚔️ 공격 벡터

로컬 공격자가 Binder 트랜잭션을 정교하게 조작하여 레이스 컨디션을 유발함으로써 메모리 오염 및 권한 상승 시도 가능

🛡️ 대응 방법

리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 Binder 드라이버의 참조 카운트 로직 수정 적용

🔧 검증 코드

출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel