🇰🇷 한글 설명
Linux 커널의 Bluetooth ISO 프로토콜 구현에서 iso_conn_ready() 함수 내 리스너 소켓의 Use-After-Free 취약점이 발견되었습니다. 소켓이 생성되는 과정에서 동시성 문제로 인해 이미 해제된 소켓 참조를 사용하게 되어 시스템 불안정이나 권한 상승을 초래할 수 있습니다.
💡 쉬운 설명
블루투스 연결을 준비하는 과정에서 이미 닫혀버린 연결 정보를 다시 사용하려고 시도할 때 발생하는 오류입니다. 이로 인해 컴퓨터의 메모리 관리 체계가 망가져 시스템이 멈추거나 해킹에 이용될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: ISO: fix use-after-free of listener socket in iso_conn_ready
iso_conn_ready() looks up the BIS listener socket with iso_get_sock(),
which takes a reference, and then, without re-checking its state,
creates a child socket from it:
parent = iso_get_sock(hdev, ...);
if (!parent)
return;
lock_sock(parent);
sk = iso_sock_alloc(sock_net(parent), NULL, BTPROTO_ISO, ...);
...
iso_chan_add(conn, sk, parent);
...
release_sock(parent);
sock_put(parent);
If the listener socket is closed concurrently, between iso_get_sock()
and lock_sock(), the reference taken by iso_get_sock() may be the last
one: the close path drops the link-list reference, and once
iso_conn_ready() drops its own reference at the end of the function the
socket is freed. The child socket, however, is already linked to the
freed parent, and a later disconnect of the child runs iso_chan_del()
-> bt_accept_unlink(), which dereferences the dangling parent pointer
into the freed accept queue (a use-after-free). The same dangling
pointer is also dereferenced through parent->***() in
iso_chan_del().
Fix it the same way the connected (non-BIS) path was fixed in commit
0d255e63fcf3 ("Bluetooth: ISO: hold sk properly in iso_conn_ready"):
after taking the socket lock, re-check that the parent is still a
listening, alive socket, and bail out otherwise.
📍 영향받는 시스템
Bluetooth ISO 기능을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
악의적인 블루투스 연결 요청을 통해 소켓의 생성과 해제를 동시에 유도하는 레이스 컨디션 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 iso_conn_ready() 함수의 소켓 상태 확인 로직을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전 이상인지 확인합니다.