🇰🇷 한글 설명
Linux 커널의 qcom-geni-serial 드라이버에서 RX FIFO 버퍼 크기 불일치로 인한 slab-out-of-bounds 취약점이 발견되었습니다. 드라이버 초기화 시 할당된 버퍼 크기보다 실제 장치의 FIFO 깊이가 더 클 경우, 데이터를 읽는 과정에서 메모리 경계를 초과하여 쓰기가 발생할 수 있습니다.
💡 쉬운 설명
데이터를 담는 그릇(버퍼)은 작게 만들어졌는데, 실제 들어오는 데이터 양은 그보다 많아서 그릇 밖으로 데이터가 넘쳐흐르는 문제입니다. 이로 인해 시스템의 중요한 메모리 영역이 망가질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer
Driver's probe allocates memory for RX FIFO (port->rx_fifo) based on
default RX FIFO depth, e.g. 16. Later during serial startup the
qcom_geni_serial_port_setup() updates the RX FIFO depth
(port->rx_fifo_depth) to match real device capabilities, e.g. to 32.
The RX UART handle code will read "port->rx_fifo_depth" number of words
into "port->rx_fifo" buffer, thus exceeding the bounds. This can be
observed in certain configurations with Qualcomm Bluetooth HCI UART
device and KASAN:
Bluetooth: hci0: QCA Product ID :0x00000010
Bluetooth: hci0: QCA SOC Version :0x400a0200
Bluetooth: hci0: QCA ROM Version :0x00000200
Bluetooth: hci0: QCA Patch Version:0x00000d2b
Bluetooth: hci0: QCA controller version 0x02000200
Bluetooth: hci0: QCA Downloading qca/htbtfw20.tlv
bluetooth hci0: Direct firmware load for qca/htbtfw20.tlv failed with error -2
Bluetooth: hci0: QCA Failed to request file: qca/htbtfw20.tlv (-2)
Bluetooth: hci0: QCA Failed to download patch (-2)
==================================================================
BUG: KASAN: slab-out-of-bounds in handle_rx_uart+0xa8/0x18c
Write of size 4 at addr ffff279347d578c0 by task swapper/0/0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.1.0-rt5-00350-gb2450b7e00be-dirty #26
Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT)
Call trace:
dump_backtrace.part.0+0xe0/0xf0
show_stack+0x18/0x40
dump_stack_lvl+0x8c/0xb8
print_report+0x188/0x488
kasan_report+0xb4/0x100
__asan_store4+0x80/0xa4
handle_rx_uart+0xa8/0x18c
qcom_geni_serial_handle_rx+0x84/0x9c
qcom_geni_serial_isr+0x24c/0x760
__handle_irq_event_percpu+0x108/0x500
handle_irq_event+0x6c/0x110
handle_fasteoi_irq+0x138/0x2cc
generic_handle_domain_irq+0x48/0x64
If the RX FIFO depth changes after probe, be sure to resize the buffer.
📍 영향받는 시스템
Qualcomm GENI Serial 드라이버를 사용하는 Linux 커널 시스템 (특히 Bluetooth HCI UART 장치 사용 환경)
⚔️ 공격 벡터
특정 하드웨어 구성에서 조작된 UART 데이터를 전송하여 메모리 경계를 초과하는 쓰기를 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하거나, RX FIFO 깊이 변경 시 버퍼 크기를 재할당하도록 수정된 드라이버 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인