🇰🇷 한글 설명
Linux 커널의 Bluetooth L2CAP 프로토콜 구현에서 l2cap_sock_cleanup_listen()과 l2cap_conn_del() 간의 경쟁 상태로 인한 Use-After-Free(UAF) 취약점이 발견되었습니다. HCI 연결 해제 시 발생하는 동시성 문제로 인해 이미 해제된 메모리 영역에 접근하여 시스템 불안정이나 권한 상승을 초래할 수 있습니다.
💡 쉬운 설명
블루투스 연결을 끊는 과정에서 컴퓨터가 이미 삭제한 데이터를 다시 사용하려고 시도할 때 발생하는 오류입니다. 이 오류를 이용하면 해커가 시스템의 제어권을 뺏거나 컴퓨터를 강제로 종료시킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: fix UAF in l2cap_sock_cleanup_listen() vs l2cap_conn_del()
bt_accept_dequeue() unlinks a not-yet-accepted child from the parent
accept queue and release_sock()s it before returning, so the returned
sk has no caller reference and is unlocked.
l2cap_sock_cleanup_listen() walks these children on listening-socket
close. A concurrent HCI disconnect drives hci_rx_work ->
l2cap_conn_del() which runs l2cap_chan_del() + l2cap_sock_kill() and
frees the child sk and its l2cap_chan; cleanup_listen() then uses both:
BUG: KASAN: slab-use-after-free in l2cap_sock_kill
l2cap_sock_kill / l2cap_sock_cleanup_listen / __x64_sys_close
Freed by: l2cap_conn_del -> l2cap_sock_close_cb -> l2cap_sock_kill
This is distinct from the two fixes already in this area: commit
e83f5e24da741 ("Bluetooth: serialize accept_q access") serialises the
accept_q list/poll and takes temporary refs inside bt_accept_dequeue(),
and CVE-2025-39860 serialises the userspace close()/accept() race by
calling cleanup_listen() under lock_sock() in l2cap_sock_release().
Neither covers l2cap_conn_del() running from hci_rx_work, so this UAF
still reproduces on current bluetooth/master.
Take the reference at the source: bt_accept_dequeue() does sock_hold()
while sk is still locked, before release_sock(); callers sock_put().
cleanup_listen() pins the chan with l2cap_chan_hold_unless_zero() under
a brief child sk lock (serialising vs l2cap_sock_teardown_cb()), drops
it before l2cap_chan_lock(), and skips a duplicate l2cap_sock_kill() on
SOCK_DEAD. conn->lock is not taken here: cleanup_listen() runs under
the parent sk lock and that would invert
conn->lock -> chan->lock -> sk_lock (lockdep).
KASAN/SMP: an unprivileged listen/close vs HCI-disconnect race produced
12 use-after-free reports per run before this change; 0, and no lockdep
report, over 1600+ raced iterations after it on bluetooth/master.
📍 영향받는 시스템
Linux kernel (Bluetooth L2CAP stack 포함 버전)
⚔️ 공격 벡터
비특권 사용자가 블루투스 연결을 생성한 후, 특정 타이밍에 연결을 해제(HCI disconnect)하여 경쟁 상태를 유도함
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인하십시오.