🇰🇷 한글 설명
Linux 커널의 libnvdimm 드라이버에서 nd_label_data_init() 함수 실행 중 0 나누기 오류가 발생할 수 있습니다. 결함이 있는 CXL 메모리 장치가 LSA 크기를 0으로 반환하면 max_xfer가 0이 되어 DIV_ROUND_UP() 연산에서 커널 오류(Oops)가 발생합니다. 설정 크기 검사를 강화하여 이를 수정했습니다.
💡 쉬운 설명
일부 고장난 CXL 메모리 장치가 잘못된 크기 정보를 보내면 리눅스 커널이 계산 중 오류로 멈출 수 있습니다. 커널 업데이트를 통해 이 잘못된 값을 걸러내도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
libnvdimm/labels: Fix divide error in nd_label_data_init()
If a faulty CXL memory device returns a broken zero LSA size in its
memory device information (Identify Memory Device (Opcode 4000h), CXL
spec. 3.1, 8.2.9.9.1.1), a divide error occurs in the libnvdimm
driver:
Oops: divide error: 0000 [#1] PREEMPT SMP NOPTI
RIP: 0010:nd_label_data_init+0x10e/0x800 [libnvdimm]
Code and flow:
1) CXL Command 4000h returns LSA size = 0
2) config_size is assigned to zero LSA size (CXL pmem driver):
drivers/cxl/pmem.c: .config_size = mds->lsa_size,
3) max_xfer is set to zero (nvdimm driver):
drivers/nvdimm/label.c: max_xfer = min_t(size_t, ndd->nsarea.max_xfer, config_size);
4) A subsequent DIV_ROUND_UP() causes a division by zero:
drivers/nvdimm/label.c: /* Make our initial read size a multiple of max_xfer size */
drivers/nvdimm/label.c: read_size = min(DIV_ROUND_UP(read_size, max_xfer) * max_xfer,
drivers/nvdimm/label.c- config_size);
Fix this by checking the config size parameter by extending an
existing check.
📍 영향받는 시스템
CXL 메모리 장치를 사용하는 Linux 커널 시스템 (수정 이전 커널 버전, 정확한 범위는 커널 패치 이력 확인 필요)
⚔️ 공격 벡터
결함이 있거나 악의적으로 조작된 CXL 메모리 장치가 LSA 크기를 0으로 응답하여 커널 서비스 거부(패닉)를 유발
🛡️ 대응 방법
배포판 제공 최신 커널로 업데이트하거나 CVE-2025-38072 수정이 포함된 커널 패치를 적용하고 재부팅
🔧 검증 코드
커널 버전이 수정 포함 버전(배포판 보안 공지 기준)보다 최신인지 확인하고, cxl 장치 목록과 관련 모듈이 로드되어 있는지로 노출 가능성을 판단합니다. CXL 장치나 모듈이 없으면 영향이 없습니다.
uname -r; ls /sys/bus/cxl/devices 2>/dev/null | head -5; lsmod 2>/dev/null | grep -E 'libnvdimm|cxl_pmem'