🇰🇷 한글 설명
Linux 커널의 Bluetooth 스택 내 hci_le_create_cis_sync 함수에서 Use-After-Free(UAF) 취약점이 발견되었습니다. 락(lock)을 해제한 후 연결 객체(conn)를 참조하는 과정에서 동시 연결 해제가 발생하면 이미 해제된 메모리에 접근하게 됩니다. 이는 커널 메모리 손상이나 시스템 불안정을 초래할 수 있습니다.
💡 쉬운 설명
블루투스 연결을 처리하는 과정에서 이미 끊어진 연결 정보를 잘못된 시점에 다시 사용하려고 할 때 발생하는 오류입니다. 이로 인해 컴퓨터 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_sync: fix UAF in hci_le_create_cis_sync
hci_le_create_cis_sync() dereferences conn->conn_timeout after releasing
both rcu_read_lock() and hci_dev_lock(hdev). The conn pointer was
obtained from an RCU-protected iteration over hdev->conn_hash.list and
is not valid once these locks are dropped. A concurrent disconnect can
free the hci_conn between the unlock and the dereference, causing a
use-after-free read.
The cancellation mechanism in hci_conn_del() cannot prevent this because
hci_le_create_cis_pending() queues hci_create_cis_sync with data=NULL:
hci_cmd_sync_queue(hdev, hci_create_cis_sync, NULL, NULL);
While hci_conn_del() dequeues with data=conn:
hci_cmd_sync_dequeue(hdev, NULL, conn, NULL);
Since NULL != conn, the lookup in _hci_cmd_sync_lookup_entry() never
matches, and the pending work item is not cancelled.
Fix this by saving conn->conn_timeout into a local variable while the
locks are still held, so the stale conn pointer is never dereferenced
after unlock.
This is the same class of bug as the one fixed by commit 035c25007c9e
("Bluetooth: hci_sync: Fix UAF on le_read_features_complete") which
addressed the identical pattern in a different function.
This vulnerability was identified using 0sec.ai, an open-source
automated security auditing platform (https://github.com/0sec-labs).
📍 영향받는 시스템
Linux Kernel (Bluetooth hci_sync 관련 모듈 포함 버전)
⚔️ 공격 벡터
블루투스 연결 및 해제를 정교하게 조작하여 커널 메모리의 Use-After-Free 상태를 유도
🛡️ 대응 방법
커널 패치를 적용하여 락 해제 전 필요한 데이터를 로컬 변수에 미리 저장하도록 수정
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.