🇰🇷 한글 설명
Linux 커널의 SLUB 할당자에서 PREEMPT_RT 커널 사용 시 IRQ 컨텍스트에서 deactivate_slab() 또는 __free_slab()이 호출되어 발생하는 의존성 문제를 다룹니다. flush_cpu_slab() 호출이 작업 큐(workqueue)의 플러시 의존성 규칙을 위반하여 시스템 경고나 불안정성을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터의 메모리를 관리하는 과정에서 특정 작업이 잘못된 순서로 실행되어 시스템이 충돌하거나 경고를 발생시키는 문제입니다. 메모리를 비우는 작업이 시스템의 규칙을 어겨서 발생하는 소프트웨어 오류입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm: slub: fix flush_cpu_slab()/__free_slab() invocations in task context.
Commit 5a836bf6b09f ("mm: slub: move flush_cpu_slab() invocations
__free_slab() invocations out of IRQ context") moved all flush_cpu_slab()
invocations to the global workqueue to avoid a problem related
with deactivate_slab()/__free_slab() being called from an IRQ context
on PREEMPT_RT kernels.
When the flush_all_cpu_locked() function is called from a task context
it may happen that a workqueue with WQ_MEM_RECLAIM bit set ends up
flushing the global workqueue, this will cause a dependency issue.
workqueue: WQ_MEM_RECLAIM nvme-delete-wq:nvme_delete_ctrl_work [nvme_core]
is flushing !WQ_MEM_RECLAIM events:flush_cpu_slab
WARNING: CPU: 37 PID: 410 at kernel/workqueue.c:2637
check_flush_dependency+0x10a/0x120
Workqueue: nvme-delete-wq nvme_delete_ctrl_work [nvme_core]
RIP: 0010:check_flush_dependency+0x10a/0x120[ 453.262125] Call Trace:
__flush_work.isra.0+0xbf/0x220
? __queue_work+0x1dc/0x420
flush_all_cpus_locked+0xfb/0x120
__kmem_cache_shutdown+0x2b/0x320
kmem_cache_destroy+0x49/0x100
bioset_exit+0x143/0x190
blk_release_queue+0xb9/0x100
kobject_cleanup+0x37/0x130
nvme_fc_ctrl_free+0xc6/0x150 [nvme_fc]
nvme_free_ctrl+0x1ac/0x2b0 [nvme_core]
Fix this bug by creating a workqueue for the flush operation with
the WQ_MEM_RECLAIM bit set.
📍 영향받는 시스템
PREEMPT_RT 패치가 적용된 Linux 커널 (SLUB 할당자 사용 환경)
⚔️ 공격 벡터
직접적인 외부 공격보다는 특정 커널 작업(NVMe 컨트롤러 삭제 등) 수행 시 발생하는 시스템 내부 로직 오류를 이용한 서비스 거부(DoS) 가능성
🛡️ 대응 방법
커널 패치(Commit 5a836bf6b09f 적용 버전)를 통해 flush_cpu_slab() 호출을 전용 작업 큐로 이동하여 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인