🇰🇷 한글 설명
리눅스 커널의 Bluetooth HCI 이벤트 처리 과정에서 LE 수락 및 해결 목록을 초기화할 때 hdev->lock을 획득하지 않아 발생하는 Use-After-Free(UAF) 취약점입니다. 이로 인해 리셋 완료 처리와 debugfs 읽기 작업이 겹칠 경우, 이미 해제된 메모리 영역을 참조하여 시스템 오류나 보안 문제가 발생할 수 있습니다.
💡 쉬운 설명
블루투스 기능을 초기화하는 동안 시스템이 데이터를 읽으려고 시도하면, 이미 삭제된 데이터를 다시 읽으려다 충돌이 발생하는 문제입니다. 이로 인해 컴퓨터 시스템이 갑자기 멈추거나 예상치 못한 동작을 할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_event: fix LE list UAF on reset
hci_cc_reset() clears the LE accept and resolving lists without taking
hdev->lock. Other command-complete handlers serialize updates to these
lists with that lock, and the debugfs readers hold it while walking them.
This permits the reset completion and a debugfs read to interleave as
follows:
hci_rx_work debugfs reader
----------- --------------
lock hdev->lock
fetch current entry
list_del(entry)
kfree(entry)
read entry fields
The reader then dereferences a freed list entry and may follow its stale
next pointer.
KASAN reported:
BUG: KASAN: slab-use-after-free in white_list_show+0x15f/0x180
Read of size 1 at addr ffff8881015dab16 by task poc/95
Call Trace:
white_list_show+0x15f/0x180
seq_read_iter+0x3ff/0x1190
seq_read+0x267/0x3d0
vfs_read+0x177/0xa20
ksys_read+0xf7/0x1c0
Allocated by task 91:
hci_bdaddr_list_add+0x1a6/0x3a0
hci_cc_le_add_to_accept_list+0xab/0x140
hci_cmd_complete_evt+0x26c/0x9a0
hci_event_packet+0x454/0xb20
hci_rx_work+0x293/0x730
Freed by task 90:
kfree+0x131/0x3c0
hci_bdaddr_list_clear+0xd8/0x160
hci_cc_reset+0x28a/0x370
hci_cmd_complete_evt+0x26c/0x9a0
hci_event_packet+0x454/0xb20
hci_rx_work+0x293/0x730
Take hdev->lock around both list clears. This matches the existing
mutation and traversal locking convention.
📍 영향받는 시스템
Linux Kernel (Bluetooth subsystem)
⚔️ 공격 벡터
로컬 공격자가 블루투스 리셋 명령과 debugfs 읽기 작업을 정밀하게 타이밍을 맞춰 실행하여 메모리 오류 유도
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 hci_cc_reset() 함수에 hdev->lock이 적용되도록 수정
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인