🇰🇷 한글 설명
Linux 커널의 Bluetooth ISO 소켓 구현에서 동시에 두 번 listen() 호출 시 BIS 리스너 설정이 경쟁 조건으로 충돌할 수 있는 문제가 수정되었습니다. 두 번째 연결 첨부가 첫 번째 연결 참조를 누수시키고 해제된 소켓에 대한 접근(use-after-free)을 유발할 수 있습니다. 수정은 BT_BOUND 상태를 재확인하고 기존 연결이 있으면 -EBADFD로 거부합니다.
💡 쉬운 설명
블루투스 방송 기능을 여러 프로그램이 동시에 설정하려 할 때 메모리 관리 오류가 생길 수 있는 문제입니다. 이로 인해 시스템이 불안정해지거나 악의적인 코드가 메모리를 조작할 가능성이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: ISO: Reject concurrent BIS listener setup
iso_sock_listen() drops the socket lock before calling iso_listen_bis()
to preserve the hdev->lock ordering. Two concurrent listen() calls on
the same broadcast socket can therefore both observe BT_BOUND. Caller
A can attach connA and release the locks, then caller B can acquire
them and attach connB before A publishes BT_LISTEN.
__iso_chan_add() checks whether connB already has a socket, but not
whether the socket already has a connection. The second attachment
overwrites iso_pi(sk)->conn, leaking the connA reference and leaving
connA->sk intact. Socket teardown follows connB, so later events on
connA can cause a stale socket access.
Recheck BT_BOUND and require iso_pi(sk)->conn to be NULL after taking
both the HCI device and socket locks in iso_listen_bis(). The connection
check also covers the interval between attachment and publication of
BT_LISTEN. Reject a competing setup with -EBADFD through the existing
unlock path before allocating another connection.
A recorded KASAN report from an instrumented kernel shows:
BUG: KASAN: slab-use-after-free in iso_sock_hold+0x119/0x1f0
Call Trace:
iso_sock_hold+0x119/0x1f0
iso_conn_del+0xe4/0x270
hci_disconn_complete_evt+0x351/0x8c0
hci_event_packet+0x71b/0xb20
hci_rx_work+0x293/0x730
Allocated by task 93:
sk_prot_alloc+0x113/0x220
sk_alloc+0x2b/0x6d0
bt_sock_alloc+0x29/0x370
iso_sock_alloc.constprop.0+0x19/0x300
iso_sock_create+0x94/0x100
Freed by task 93:
kfree+0x121/0x3c0
__sk_destruct+0x42b/0x540
iso_sock_release+0x29d/0x340
__sock_release+0xa1/0x260
sock_close+0x10/0x20
📍 영향받는 시스템
Linux 커널의 Bluetooth ISO(BIS 브로드캐스트) 기능을 사용하는 시스템 (수정 커밋 이전 커널 버전)
⚔️ 공격 벡터
로컬 사용자가 브로드캐스트 Bluetooth 소켓에 대해 동시에 listen() 호출을 유발하여 경쟁 조건을 일으키고 메모리 손상을 유도
🛡️ 대응 방법
패키지 관리자로 커널을 최신 보안 업데이트 버전으로 업그레이드하고 재부팅
🔧 검증 코드
출력된 커널 버전이 배포판의 보안 패치 적용 버전(수정 커밋 포함) 이상인지 확인하고, 해당 버전 정보는 배포판 보안 공지에서 대조