🇰🇷 한글 설명
Linux 커널의 SCSI 타겟 코어에서 iSCSI ISID 처리 중 Use-After-Free 취약점이 발견되었습니다. REGISTER AND MOVE 명령 수행 시 파라미터 리스트를 조기에 언맵(unmap)하여, 이후 해제된 메모리 영역에 접근할 때 발생하는 결함입니다.
💡 쉬운 설명
컴퓨터의 저장 장치와 통신하는 과정에서 이미 사용이 끝난 메모리 주소를 다시 참조하여 발생하는 오류입니다. 이로 인해 시스템이 멈추거나 해커가 시스템 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: target: core: Fix iSCSI ISID use-after-free in REGISTER AND MOVE
core_scsi3_emulate_pro_register_and_move() maps the PERSISTENT RESERVE OUT
parameter list with transport_kmap_data_sg() and parses the destination
TransportID with target_parse_pr_out_transport_id(). For an iSCSI
TransportID (FORMAT CODE 01b), iscsi_parse_pr_out_transport_id() returns
the ISID in iport_ptr as a raw pointer into that mapped buffer.
The function then unmaps the buffer with transport_kunmap_data_sg() before
dereferencing iport_ptr in strcmp(), __core_scsi3_locate_pr_reg() and
core_scsi3_alloc_registration(). When the parameter list spans more than
one page (PARAMETER LIST LENGTH > 4096), transport_kmap_data_sg() uses
vmap() and transport_kunmap_data_sg() does vunmap(), so the kernel virtual
address backing iport_ptr is torn down and every subsequent dereference is
a use-after-free read of the unmapped region.
Keep the parameter list mapped until iport_ptr is no longer needed: drop
the early transport_kunmap_data_sg() and unmap once on the success path,
right before returning. The error paths already unmap through the existing
"if (buf) transport_kunmap_data_sg(cmd)" at the out: label, which now runs
on every post-map error exit because buf is no longer cleared early. Only
reads of the mapping happen while spinlocks are held; the map and unmap
calls remain outside any lock. The sibling caller
core_scsi3_decode_spec_i_port() already uses the buffer before unmapping it
and is left unchanged.
📍 영향받는 시스템
Linux Kernel (scsi: target: core 관련 iSCSI 구현 포함 버전)
⚔️ 공격 벡터
특수하게 조작된 iSCSI REGISTER AND MOVE 명령을 전송하여 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이상인지 확인