🇰🇷 한글 설명
Linux 커널의 Bluetooth 6lowpan 모듈에서 발생하는 레이스 컨디션 취약점입니다. debugfs를 통해 활성화 작업을 예약할 때, 작업이 완료되기 전 모듈이 종료되면 이미 해제된 메모리 영역에 접근하여 Use-After-Free 오류를 유발할 수 있습니다.
💡 쉬운 설명
블루투스 기능을 켜는 작업이 끝나기도 전에 블루투스 프로그램이 먼저 종료되어 버리는 문제입니다. 이 과정에서 컴퓨터가 이미 사라진 데이터를 다시 사용하려고 시도하다가 시스템 오류나 충돌이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: 6lowpan: avoid untracked enable work
lowpan_enable_set() allocates a temporary work item and schedules
do_enable_set() on system_wq, then returns to debugfs. The debugfs active
operation has ended at that point, but the worker still executes module
text and manipulates enable_6lowpan and listen_chan.
bt_6lowpan_exit() removes the debugfs files and immediately closes and
puts listen_chan. It has no pointer to the queued work item, so it cannot
cancel or flush it before tearing down the state that the worker uses.
The buggy scenario involves two paths, with each column showing the order
within that path:
debugfs enable write module exit
1. lowpan_enable_set() allocates 1. bt_6lowpan_exit() removes
set_enable work the debugfs file
2. schedule_work() queues 2. bt_6lowpan_exit() closes
do_enable_set() and puts listen_chan
3. the write operation returns 3. module teardown can continue
4. do_enable_set() later runs
against stale state
Run the enable state transition synchronously in lowpan_enable_set()
instead. The simple debugfs setter can sleep, and this file already handles
the 6LoWPAN control write synchronously under the same set_lock. Once the
setter returns, debugfs removal covers the whole operation and exit can no
longer race with an untracked work item.
Validation reproduced this kernel report:
BUG: KASAN: slab-use-after-free in do_enable_set+0x113/0x2e0
Workqueue: events do_enable_set [bluetooth_6lowpan]
The buggy address belongs to the object at ffff888109cb8000
📍 영향받는 시스템
Linux Kernel (Bluetooth 6lowpan 모듈 포함 버전)
⚔️ 공격 벡터
특수하게 조작된 debugfs 쓰기 작업을 통해 모듈 종료 시점과 작업 실행 시점 사이의 레이스 컨디션 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 6lowpan 활성화 작업을 동기 방식으로 변경
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인