🇰🇷 한글 설명
Linux 커널의 nvmet 구성 요소에서 QP(Queue Pair) 설정 중 컨트롤러를 파괴할 때 발생할 수 있는 메모리 누수 취약점입니다. 관리자 연결 요청 처리와 연결 해제 과정이 동시에 발생할 때, 컨트롤러의 참조 횟수가 제대로 감소하지 않아 메모리가 해제되지 않는 레이스 컨디션 문제가 존재합니다.
💡 쉬운 설명
컴퓨터의 저장 장치 연결을 관리하는 프로그램에서, 연결을 시도하는 동시에 끊으려고 할 때 메모리가 제대로 정리되지 않고 쌓이는 버그입니다. 이 문제가 반복되면 시스템의 메모리가 부족해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nvmet: fix a possible leak when destroy a ctrl during qp establishment
In nvmet_sq_destroy we capture sq->ctrl early and if it is non-NULL we
know that a ctrl was allocated (in the admin connect request handler)
and we need to release pending AERs, clear ctrl->sqs and sq->ctrl
(for nvme-loop primarily), and drop the final reference on the ctrl.
However, a small window is possible where nvmet_sq_destroy starts (as
a result of the client giving up and disconnecting) concurrently with
the nvme admin connect cmd (which may be in an early stage). But *before*
kill_and_confirm of sq->ref (i.e. the admin connect managed to get an sq
live reference). In this case, sq->ctrl was allocated however after it was
captured in a local variable in nvmet_sq_destroy.
This prevented the final reference drop on the ctrl.
Solve this by re-capturing the sq->ctrl after all inflight request has
completed, where for sure sq->ctrl reference is final, and move forward
based on that.
This issue was observed in an environment with many hosts connecting
multiple ctrls simoutanuosly, creating a delay in allocating a ctrl
leading up to this race window.
📍 영향받는 시스템
Linux kernel (nvmet subsystem)
⚔️ 공격 벡터
다수의 호스트가 동시에 여러 컨트롤러에 연결을 시도하여 레이스 컨디션(경쟁 상태)을 유도하는 방식
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.