🇰🇷 한글 설명
Linux 커널의 NVMe 드라이버에서 zone 정보 쿼리가 실패했을 때 이를 적절히 처리하지 못해 발생하는 취약점입니다. 쿼리 실패 시 0으로 초기화된 zone 정보를 사용하여 제한 사항을 업데이트함으로써, 잘못된 zone 크기(0)로 인해 커널 내에서 shift-out-of-bounds 오류 및 시스템 불안정을 초래할 수 있습니다.
💡 쉬운 설명
NVMe 저장 장치로부터 정보를 가져오는 과정에서 오류가 발생하면, 컴퓨터가 잘못된 정보를 바탕으로 저장 장치를 관리하려고 시도합니다. 이로 인해 시스템이 계산 오류를 일으키며 멈추거나 비정상적으로 동작할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nvme: skip the zoned limits update if the zone info query failed
nvme_query_zone_info() returns either a negative errno or a positive
NVMe status code, but nvme_update_ns_info_block() only tests for the
negative case:
ret = nvme_query_zone_info(ns, lbaf, &zi);
if (ret < 0)
goto out;
If the device fails the Identify Namespace (I/O Command Set specific)
command, or the Identify Controller command issued by
nvme_set_max_append(), the positive status falls through and setup
continues with the zero-initialized zone info. nvme_update_zone_info()
then marks the queue zoned with chunk_sectors and ns->head->zsze set to
zero.
blk_validate_zoned_limits() does not check chunk_sectors, so the limits
commit succeeds. blk_revalidate_disk_zones() does reject the zero zone
size, but by then the limits are live and nothing rolls them back, so
I/O keeps being submitted to a zoned queue with a zero zone size and
disk_zone_no() shifts by ilog2(0):
nvme0n1: Invalid non power of two zone size (0)
UBSAN: shift-out-of-bounds in include/linux/blkdev.h:747:16
shift exponent -1 is negative
disk_zone_no include/linux/blkdev.h:747 [inline]
bio_straddles_zones include/linux/blkdev.h:1058 [inline]
blk_zone_wplug_handle_write block/blk-zoned.c:1423 [inline]
blk_zone_plug_bio.cold+0x25/0x1c8 block/blk-zoned.c:1605
blk_mq_submit_bio+0x18fb/0x2870 block/blk-mq.c:3196
submit_bh_wbc+0x575/0x740 fs/buffer.c:2824
__block_write_full_folio+0x728/0xdd0 fs/buffer.c:1933
Any device, firmware or NVMe-oF target that fails this one command
reaches this.
Skip the zoned limits update in that case, and log which of the two
things happened: during a revalidation the queue keeps the zone
geometry it was last validated with, and on a first scan the namespace
is registered without zoned limits, so that it is still available as a
handle for admin commands. Neither of the paths in
nvme_query_zone_info() that return a positive status logs anything, so
the failure would otherwise be silent.
zi.zone_size is an exact indicator: every path that returns a positive
status returns before it is assigned, and after that the only failure
left is -ENODEV, which the caller already handles.
Found by FuzzNvme.
📍 영향받는 시스템
Linux kernel (NVMe driver component)
⚔️ 공격 벡터
오류를 유발하는 NVMe 장치, 펌웨어 또는 NVMe-oF 타겟을 통한 로컬/원격 공격
🛡️ 대응 방법
NVMe zone 정보 쿼리 실패 시 업데이트를 건너뛰고 오류를 로그에 남기도록 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 확인합니다.