🇰🇷 한글 설명
Bouffalo Lab 온칩 BLE 컨트롤러(BL60x/BL70x/BL61x)용 Zephyr Bluetooth HCI 드라이버에서, 전송 실패 시 호출자가 소유한 버퍼를 드라이버가 먼저 해제하여 호스트 측에서 이중 해제(double-unref)가 발생합니다. 이로 인해 참조 카운트가 잘못 감소하고 공유 net_buf 풀에서 메모리 손상 또는 use-after-free가 일어날 수 있습니다.
💡 쉬운 설명
블루투스 데이터를 보내다 실패하면, 같은 데이터 조각을 두 번 지워버려 기기 내부 메모리가 깨집니다. 그 결과 블루투스 기능이 멈추거나 기기가 재부팅될 수 있습니다.
🇺🇸 원문 (English)
The Bluetooth HCI driver for Bouffalo Lab on-chip BLE controllers (BL60x/BL70x/BL61x), bt_bflb_send() in drivers/bluetooth/hci/hci_bflb.c, violates the bt_hci_driver_api.send() buffer-ownership contract. That contract (documented at include/zephyr/drivers/bluetooth.h) requires the buffer reference to be consumed only on success; on error the caller still owns the reference and unrefs it. The driver instead routed all error paths through a shared label that unconditionally called net_buf_unref(buf) before returning the error code, consuming the buffer on failure as well.
When send() returns an error, the host TX path (send_buf() in subsys/bluetooth/host/conn.c) unrefs the same buffer again, believing it still owns it. This double-unref over-decrements the net_buf reference count. Because the buffer is a TX fragment whose destroy callback also decrements its still-queued parent buffer, the parent is freed prematurely while reachable on the connection TX queue, producing a use-after-free and corruption of the shared net_buf pool rather than a benign leak.
The error conditions are on the host-to-controller transmit path (controller send failure, or an unsupported H:4 packet type), so they are not driven directly by attacker-supplied radio bytes; a remote/adjacent peer can influence them only indirectly, e.g. by inducing controller TX failures under heavy link load. The consequence when reached is BLE-stack denial of service (crash / pool corruption) with possible further memory corruption, bounded to devices using one of these Bouffalo Lab on-chip controllers.
📍 영향받는 시스템
Zephyr RTOS의 hci_bflb.c 드라이버를 사용하는 Bouffalo Lab BL60x/BL70x/BL61x 온칩 BLE 컨트롤러 기기
⚔️ 공격 벡터
원격 또는 인접 공격자가 링크에 과부하를 유발해 컨트롤러 전송 실패를 간접적으로 일으키는 방식이며, 직접적인 무선 패킷 조작은 필요하지 않음
🛡️ 대응 방법
Zephyr 프로젝트의 수정된 버전(hci_bflb.c 에러 경로 수정 패치)으로 펌웨어를 업데이트
🔧 검증 코드
에러 경로 공유 레이블에서 조건 없이 net_buf_unref가 호출되면 취약하며, 에러 반환 전에 소유권 해제가 조건부로 처리되도록 수정되었는지 코드를 확인합니다.
grep -n "net_buf_unref" drivers/bluetooth/hci/hci_bflb.c 2>/dev/null
📊 CVSS Vector String
CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H
💻 영향받는 소프트웨어
Windows Bluetooth Service