🇰🇷 한글 설명
리눅스 커널의 SCSI 타겟 계층에서 XCOPY 명령 완료 시 NULL 포인터를 참조하여 발생하는 취약점입니다. LIO의 EXTENDED COPY 작업 중 특정 상황에서 se_tpg_wwn 포인터가 NULL인 상태로 역참조되어 커널 패닉을 유발할 수 있습니다.
💡 쉬운 설명
데이터를 복사하는 특정 명령을 실행할 때, 컴퓨터가 존재하지 않는 메모리 주소를 참조하여 시스템이 갑자기 멈추거나 꺼질 수 있는 오류입니다. 이는 시스템의 안정성을 해칠 수 있는 결함입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: target: Fix NULL dereference on XCOPY completion
CPU affinity control added with commit 39ae3edda325 ("scsi: target: core:
Make completion affinity configurable") makes target_complete_cmd() queue
work on a CPU based on se_tpg->se_tpg_wwn->cmd_compl_affinity state.
LIO's EXTENDED COPY worker is a special case in that read/write cmds are
dispatched using the global xcopy_pt_tpg, which carries a NULL se_tpg_wwn
pointer following initialization in target_xcopy_setup_pt().
The NULL xcopy_pt_tpg->se_tpg_wwn pointer is dereferenced on completion of
any EXTENDED COPY initiated read/write cmds. E.g using the libiscsi
SCSI.ExtendedCopy.Simple test:
BUG: kernel NULL pointer dereference, address: 00000000000001a8
RIP: 0010:target_complete_cmd+0x9d/0x130 [target_core_mod]
Call Trace:
fd_execute_rw+0x148/0x42a [target_core_file]
? __dynamic_pr_debug+0xa7/0xe0
? target_check_reservation+0x5b/0x940 [target_core_mod]
__target_execute_cmd+0x1e/0x90 [target_core_mod]
transport_generic_new_cmd+0x17c/0x330 [target_core_mod]
target_xcopy_issue_pt_cmd+0x9/0x60 [target_core_mod]
target_xcopy_read_source.isra.7+0x10b/0x1b0 [target_core_mod]
? target_check_fua+0x40/0x40 [target_core_mod]
? transport_complete_task_attr+0x130/0x130 [target_core_mod]
target_xcopy_do_work+0x61f/0xc00 [target_core_mod]
This fix makes target_complete_cmd() queue work on se_cmd->cpuid if
se_tpg_wwn is NULL.
📍 영향받는 시스템
Linux kernel (LIO SCSI target subsystem 사용 환경)
⚔️ 공격 벡터
공격자가 특수하게 조작된 SCSI EXTENDED COPY 명령을 전송하여 커널 NULL 포인터 역참조 유도
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 target_complete_cmd()의 NULL 체크 로직을 적용해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.