🇰🇷 한글 설명
리눅스 커널의 블루투스 L2CAP 프로토콜 스택에서 소켓이 닫히는 과정과 데이터 수신 작업 간의 동기화 부재로 인해 발생하는 취약점입니다. 소켓이 해제된 후에도 작업 스레드가 해당 소켓에 접근하여 메모리 오류를 유발할 수 있습니다.
💡 쉬운 설명
블루투스 연결을 끊는 도중에 시스템이 데이터를 받으려고 시도하면, 이미 사라진 연결 정보를 참조하여 시스템이 충돌하거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bluetooth/l2cap: sync sock recv cb and release
The problem occurs between the system call to close the sock and hci_rx_work,
where the former releases the sock and the latter accesses it without lock protection.
CPU0 CPU1
---- ----
sock_close hci_rx_work
l2cap_sock_release hci_acldata_packet
l2cap_sock_kill l2cap_recv_frame
sk_free l2cap_conless_channel
l2cap_sock_recv_cb
If hci_rx_work processes the data that needs to be received before the sock is
closed, then everything is normal; Otherwise, the work thread may access the
released sock when receiving data.
Add a chan mutex in the rx callback of the sock to achieve synchronization between
the sock release and recv cb.
Sock is dead, so set chan data to NULL, avoid others use invalid sock pointer.
📍 영향받는 시스템
Linux Kernel (Bluetooth L2CAP component)
⚔️ 공격 벡터
로컬 또는 원격 블루투스 통신 과정에서 특정 타이밍에 소켓 해제와 데이터 수신을 유도하는 레이스 컨디션 공격
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 L2CAP 동기화 로직을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 보안 공지(CVE-2024-41062)와 대조하여 확인합니다.