🇰🇷 한글 설명
Linux 커널의 Bluetooth hci_core에서 ACL 스케줄링과 채널 삭제 간의 직렬화가 이루어지지 않아 발생하는 Use-After-Free 취약점입니다. hci_chan_sent() 함수가 RCU 읽기 잠금을 해제한 후 채널 데이터에 접근할 때, 다른 프로세스에서 해당 채널을 삭제하고 메모리를 해제할 수 있어 발생합니다.
💡 쉬운 설명
블루투스 연결을 처리하는 과정에서 데이터가 전송되기도 전에 연결 정보가 메모리에서 먼저 삭제되어 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_core: Serialize ACL scheduling with channel deletion
hci_chan_sent() selects a channel under RCU but drops the read lock before
accessing chan->conn and returning the channel. The ACL and LE schedulers
then use its packet queue and update its transmit counters without any
protection against channel deletion.
After TX selects a channel and releases RCU, a disconnect command timeout
on the separate request workqueue can run hci_conn_failed() and
l2cap_conn_del(). hci_chan_del() can then unlink the channel, complete
synchronize_rcu(), purge its queue and free it before TX resumes. This
causes use-after-free both in hci_chan_sent() and in its callers.
KASAN reported:
BUG: KASAN: slab-use-after-free in hci_chan_sent+0x892/0x9b0
Workqueue: hci0 hci_tx_work
Call Trace:
hci_chan_sent+0x892/0x9b0
hci_tx_work+0x5e6/0xb70
Allocated by task 91:
hci_chan_create+0xe3/0x350
l2cap_conn_add.part.0+0x12/0xa30
l2cap_chan_connect+0x110d/0x1b60
l2cap_sock_connect+0x310/0x530
Freed by task 99:
hci_chan_del+0x11f/0x170
l2cap_conn_del+0x4f1/0x800
l2cap_connect_cfm+0x88c/0xd30
hci_conn_failed+0x150/0x250
hci_abort_conn_sync+0x3e3/0x800
hci_cmd_sync_run+0x7e/0xc0
hci_abort_conn+0x105/0x1f0
disconnect_sync+0x157/0x290
hci_cmd_sync_work+0x13c/0x290
Hold the existing device mutex across channel selection and transmission
in both schedulers to serialize them with channel teardown. Keep timeout
handling outside the critical sections because hci_link_tx_to() acquires
the same mutex. This also permits the transmit path to sleep, unlike
extending the RCU read-side critical section across packet submission.
📍 영향받는 시스템
Linux Kernel (Bluetooth hci_core 관련 버전)
⚔️ 공격 벡터
특수하게 조작된 블루투스 연결/해제 요청을 통해 메모리 해제 후 접근(Use-After-Free) 유도
🛡️ 대응 방법
채널 선택 및 전송 과정에서 디바이스 뮤텍스(device mutex)를 유지하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.