🇰🇷 한글 설명
리눅스 커널의 nvmet 구성 요소에서 P2P 장치는 발견되었으나 P2P 풀이 비어 있는 경우, 할당되지 않은 p2pmem의 SGL을 해제하려고 시도하여 커널 BUG(크래시)가 발생하는 취약점입니다. 이는 잘못된 메모리 풀 참조로 인해 시스템 중단을 야기할 수 있습니다.
💡 쉬운 설명
컴퓨터가 메모리를 정리할 때, 사용하지도 않은 빈 상자를 정리하려고 시도하다가 시스템이 멈춰버리는 오류입니다. 이로 인해 서버가 갑자기 꺼지거나 재부팅될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nvmet: fix freeing unallocated p2pmem
In case p2p device was found but the p2p pool is empty, the nvme target
is still trying to free the sgl from the p2p pool instead of the
regular sgl pool and causing a crash (BUG() is called). Instead, assign
the p2p_dev for the request only if it was allocated from p2p pool.
This is the crash that was caused:
[Sun May 30 19:13:53 2021] ------------[ cut here ]------------
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
[Sun May 30 19:13:53 2021] invalid opcode: 0000 [#1] SMP PTI
...
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
...
[Sun May 30 19:13:53 2021] RIP: 0010:gen_pool_free_owner+0xa8/0xb0
...
[Sun May 30 19:13:53 2021] Call Trace:
[Sun May 30 19:13:53 2021] ------------[ cut here ]------------
[Sun May 30 19:13:53 2021] pci_free_p2pmem+0x2b/0x70
[Sun May 30 19:13:53 2021] pci_p2pmem_free_sgl+0x4f/0x80
[Sun May 30 19:13:53 2021] nvmet_req_free_sgls+0x1e/0x80 [nvmet]
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
[Sun May 30 19:13:53 2021] nvmet_rdma_release_rsp+0x4e/0x1f0 [nvmet_rdma]
[Sun May 30 19:13:53 2021] nvmet_rdma_send_done+0x1c/0x60 [nvmet_rdma]
📍 영향받는 시스템
Linux Kernel (nvmet module 사용 환경)
⚔️ 공격 벡터
특수하게 조작된 NVMe-over-Fabrics 요청을 통해 P2P 메모리 할당 로직의 오류를 유도하여 커널 크래시 유발
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.