🇰🇷 한글 설명
Linux 커널의 Bluetooth hci_uart 모듈에서 발생하는 레이스 컨디션 취약점입니다. hci_uart_register_dev() 호출 중 TTY 쓰기 웨이크업이 발생하면, hu->priv가 초기화되기 전에 hci_uart_write_work()가 실행되어 NULL 포인터 역참조가 발생할 수 있습니다.
💡 쉬운 설명
블루투스 장치를 연결하는 과정에서 시스템이 준비를 다 마치기도 전에 데이터 처리를 시도하여 오류가 발생하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 충돌할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_uart: fix null-ptr-deref in hci_uart_write_work
hci_uart_set_proto() sets HCI_UART_PROTO_INIT before calling
hci_uart_register_dev(), which calls proto->open() to initialize
hu->priv. However, if a TTY write wakeup occurs during this window,
hci_uart_tx_wakeup() may schedule write_work before hu->priv is
initialized, leading to a NULL pointer dereference in
hci_uart_write_work() when proto->dequeue() accesses hu->priv.
The race condition is:
CPU0 CPU1
---- ----
hci_uart_set_proto()
set_bit(HCI_UART_PROTO_INIT)
hci_uart_register_dev()
tty write wakeup
hci_uart_tty_wakeup()
hci_uart_tx_wakeup()
schedule_work(&hu->write_work)
proto->open(hu)
// initializes hu->priv
hci_uart_write_work()
hci_uart_dequeue()
proto->dequeue(hu)
// accesses hu->priv (NULL!)
Fix this by moving set_bit(HCI_UART_PROTO_INIT) after proto->open()
succeeds, ensuring hu->priv is initialized before any work can be
scheduled.
📍 영향받는 시스템
Linux Kernel (Bluetooth hci_uart module)
⚔️ 공격 벡터
특정 타이밍에 TTY 쓰기 웨이크업을 유도하여 발생하는 레이스 컨디션 공격
🛡️ 대응 방법
커널 패치를 적용하여 hci_uart_set_proto() 내의 초기화 순서를 변경해야 함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.