🇰🇷 한글 설명
Linux 커널의 Bluetooth hci_sync 모듈에서 발생하는 Use-After-Free 취약점입니다. hci_dev_close_sync() 함수가 hdev->lock을 해제한 후 로컬 코덱 리스트를 정리하기 때문에, 리스트를 읽는 과정과 충돌하여 메모리 오류가 발생할 수 있습니다.
💡 쉬운 설명
블루투스 연결을 종료하는 과정에서 메모리 정리 순서가 잘못되어, 이미 삭제된 데이터를 다른 프로그램이 읽으려고 시도하다가 시스템 오류가 발생하는 문제입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_sync: Serialize local codec list cleanup
hci_dev_close_sync() clears hdev->local_codecs after releasing hdev->lock.
Codec list additions and both traversals in sco_sock_getsockopt() use that
lock, but the close path does not. A close and BT_CODEC query can therefore
interleave as follows:
hci_dev_close_sync() sco_sock_getsockopt()
hci_dev_lock()
fetch codec entry
hci_codec_list_clear()
kfree(entry)
read entry->id
The reader then accesses an entry which the close path has freed. KASAN
BUG: KASAN: slab-use-after-free in sco_sock_getsockopt+0xfa0/0xfe0
Read of size 1 at addr ffff8881001c3450
Call Trace:
sco_sock_getsockopt+0xfa0/0xfe0
do_sock_getsockopt+0x537/0x7b0
__sys_getsockopt+0xf2/0x170
Allocated by task 92:
hci_codec_list_add.isra.0+0x2c/0x440
hci_read_codec_capabilities+0x224/0x590
hci_read_supported_codecs+0x2c2/0x640
Freed by task 92:
kfree+0x131/0x3c0
hci_codec_list_clear+0xd8/0x160
hci_dev_close_sync+0x92a/0xfa0
Take hdev->lock around the clear operation at its existing point in the
close path. This makes the clear wait for active readers and prevents a new
traversal until the list is empty without changing teardown ordering.
📍 영향받는 시스템
Linux Kernel (Bluetooth hci_sync 관련 모듈 포함 버전)
⚔️ 공격 벡터
로컬 공격자가 블루투스 코덱 쿼리(BT_CODEC)를 특정 타이밍에 반복적으로 요청하여 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 hci_dev_close_sync()의 락(lock) 처리 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.
💻 영향받는 소프트웨어
NVIDIA Cloud Gaming Guest Driver for Linux