🇰🇷 한글 설명
Linux 커널의 NVMe 드라이버에서 NSID(Namespace ID) 스캔 시 발생하는 취약점입니다. NSID 범위 내의 빈 공간(gap)을 처리할 때, 실제 존재하는 네임스페이스 수가 아닌 NSID의 수만큼 루프를 반복하여 CPU 점유율이 급증하고 시스템이 멈추는 소프트 락업(soft lockup) 현상이 발생할 수 있습니다.
💡 쉬운 설명
저장 장치의 번호표를 확인하는 과정에서, 번호가 듬성듬성 비어있을 경우 컴퓨터가 빈 번호를 일일이 다 확인하느라 과부하가 걸려 멈추는 문제입니다. 이를 해결하기 위해 빈 구간을 한 번에 건너뛰도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nvme: remove stale namespaces by NSID range during scan
nvme_scan_ns_list() drops the stale namespaces in each gap in the
reported NSID list one NSID at a time. Every iteration calls
nvme_find_get_ns() to look the namespace up and removes it if it is
present. The loop runs once per NSID in the gap rather than once per
namespace actually present.
NSIDs are 32-bit, so a target with a sparse NSID space can make a
single gap spin the loop billions of times with nothing to remove.
watchdog: BUG: soft lockup - CPU#4 stuck for 26s!
Workqueue: nvme-wq nvme_scan_work [nvme_core]
RIP: 0010:__srcu_read_unlock+0xb/0x20
Call Trace:
nvme_find_get_ns+0x7d/0xb0 [nvme_core]
nvme_scan_ns_list+0xe8/0x280 [nvme_core]
nvme_scan_work+0x18a/0x280 [nvme_core]
process_one_work+0x197/0x380
worker_thread+0x2fe/0x410
kthread+0xe0/0x100
Rename nvme_remove_invalid_namespaces() to nvme_remove_nsid_range()
and give it an open (start, end) NSID range. ctrl->namespaces is
sorted by NSID, so the whole gap is dropped in a single walk that
stops once end is reached. This bounds the work by the namespaces
that are present instead of by the size of the gap.
📍 영향받는 시스템
NVMe 드라이버를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
공격자가 희소한(sparse) NSID 범위를 가진 악의적인 NVMe 장치를 연결하여 시스템 리소스를 고갈시킴
🛡️ 대응 방법
NVMe 관련 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이상인지 확인