🇰🇷 한글 설명
Linux 커널의 SCSI 타겟 계층에서 LUN_RESET 처리 시 발생하는 경합 조건 취약점입니다. 여러 세션에서 동시에 리셋 명령이 들어올 경우, 특정 세션의 명령이 제대로 정리되지 않은 상태에서 성공 응답을 보내어 데이터 무결성 오류나 시스템 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터 저장 장치에 명령을 내리는 과정에서 두 개의 명령이 동시에 충돌하여, 실제로는 작업이 끝나지 않았는데 끝났다고 착각하게 만드는 버그입니다. 이로 인해 잘못된 데이터가 처리되거나 시스템이 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: target: Fix multiple LUN_RESET handling
This fixes a bug where an initiator thinks a LUN_RESET has cleaned up
running commands when it hasn't. The bug was added in commit 51ec502a3266
("target: Delete tmr from list before processing").
The problem occurs when:
1. We have N I/O cmds running in the target layer spread over 2 sessions.
2. The initiator sends a LUN_RESET for each session.
3. session1's LUN_RESET loops over all the running commands from both
sessions and moves them to its local drain_task_list.
4. session2's LUN_RESET does not see the LUN_RESET from session1 because
the commit above has it remove itself. session2 also does not see any
commands since the other reset moved them off the state lists.
5. sessions2's LUN_RESET will then complete with a successful response.
6. sessions2's inititor believes the running commands on its session are
now cleaned up due to the successful response and cleans up the running
commands from its side. It then restarts them.
7. The commands do eventually complete on the backend and the target
starts to return aborted task statuses for them. The initiator will
either throw a invalid ITT error or might accidentally lookup a new
task if the ITT has been reallocated already.
Fix the bug by reverting the patch, and serialize the execution of
LUN_RESETs and Preempt and Aborts.
Also prevent us from waiting on LUN_RESETs in core_tmr_drain_tmr_list,
because it turns out the original patch fixed a bug that was not
mentioned. For LUN_RESET1 core_tmr_drain_tmr_list can see a second
LUN_RESET and wait on it. Then the second reset will run
core_tmr_drain_tmr_list and see the first reset and wait on it resulting in
a deadlock.
📍 영향받는 시스템
Linux Kernel (scsi: target 관련 모듈 사용 시스템)
⚔️ 공격 벡터
로컬 또는 네트워크를 통해 SCSI 타겟에 다중 LUN_RESET 명령을 전송하여 경합 조건 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 LUN_RESET 실행을 직렬화함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.