🇰🇷 한글 설명
Zephyr RTOS의 Bluetooth Classic HFP HF 역할 구현에서, RFCOMM 연결이 끊길 때 hf->tx_pending에 대기 중인 AT 명령 버퍼가 해제되지 않아 고정 풀(기본 설정 시 2개)에서 영구적으로 소실된다. 원격 Audio Gateway가 +BCS 응답과 연결 해제를 반복하면 풀이 고갈되고, 이후 Bluetooth RX 스레드가 무기한 블록되어 HCI 이벤트 처리가 중단된다. 또한 작업 핸들러가 실행 중일 때 구조체를 memset()으로 초기화하여 커널 워크큐 상태가 손상될 수 있다.
💡 쉬운 설명
블루투스 핸즈프리 기기와 연결했다가 끊는 과정을 반복하면 기기 내부의 명령 저장 공간이 점점 사라져 결국 고갈된다. 이 상태에서 추가 명령이 들어오면 기기의 블루투스 처리가 멈춰 재부팅 전까지 복구되지 않는다.
🇺🇸 원문 (English)
The Bluetooth Classic Hands-Free Profile HF role in subsys/bluetooth/host/classic/hfp_hf.c does not release the AT command buffers that are still queued on hf->tx_pending when the RFCOMM DLC goes down. hfp_hf_disconnected() only cancelled the work items and cleared hf->acl, and no other code path ever dequeues those buffers, so each one is permanently lost from the fixed hf_pool (CONFIG_BT_MAX_CONN + 1 buffers, i.e. two in the default configuration). The same function also left BT_HFP_HF_FLAG_CONNECTED set, and hfp_hf_create() wiped the object with memset() as soon as hf->acl was NULL, without checking whether hf->work, hf->slc_work or hf->deferred_work was still pending or running.
The remote Audio Gateway peer controls the trigger end to end and needs no application involvement: an unsolicited +BCS: 1 response makes bcs_handle() call bt_hfp_hf_select_codec() and queue an AT+BCS buffer, which cannot be transmitted while BT_HFP_HF_FLAG_RX_ONGOING is set, and an immediately following RFCOMM DISC strands that buffer. Repeating the connect / +BCS / disconnect cycle a couple of times empties hf_pool for good.
With the pool exhausted, HFP command sending fails permanently, and because hfp_hf_send_cmd() allocates with K_FOREVER (bt_rfcomm_create_pdu() → bt_conn_create_pdu()) from the Bluetooth RX context — where that timeout is not downgraded to K_NO_WAIT — one further +BCS from the peer parks the Bluetooth RX thread inside net_buf_alloc() with no possible waker, halting all HCI event processing until the device is rebooted. Separately, reusing the HF slot while a work handler was still queued or running allowed memset() to wipe live k_work items out from under the system workqueue, corrupting shared kernel workqueue state. Exploitation requires an established HFP session (for SSP devices L2CAP enforces authentication before the RFCOMM channel is reachable) and a build with CONFIG_BT_HFP_HF enabled.
📍 영향받는 시스템
CONFIG_BT_HFP_HF가 활성화된 Zephyr RTOS 빌드 (패치 이전 버전)
⚔️ 공격 벡터
인증된 HFP 세션에서 원격 Audio Gateway가 +BCS 응답 후 즉시 RFCOMM DISC를 보내는 연결/해제 사이클을 반복하여 버퍼 풀을 고갈시키고 Bluetooth RX 스레드를 영구 블록
🛡️ 대응 방법
Zephyr RTOS를 CVE-2026-77684 수정이 포함된 최신 버전으로 업데이트하고, 연결 해제 시 tx_pending 버퍼를 해제하며 작업 완료 전 HF 슬롯 재사용을 막는 패치를 적용
🔧 검증 코드
사용 중인 Zephyr 버전이 패치된 릴리스 이상인지 확인하고, hfp_hf_disconnected() 경로에서 tx_pending 버퍼를 해제하는 코드가 존재하는지 확인하며 결과가 없거나 버전이 구버전이면 취약한 것으로 판단
west list zephyr 2>/dev/null | grep -i revision; grep -n 'tx_pending' subsys/bluetooth/host/classic/hfp_hf.c 2>/dev/null
📊 CVSS Vector String
CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
💻 영향받는 소프트웨어
TeamViewer Remote Control App