🇰🇷 한글 설명
Linux 커널의 SCSI sg 드라이버에서 장치가 제거될 때 활성 명령의 완료를 기다리지 못하는 취약점입니다. 이로 인해 SG_FLAG_DIRECT_IO를 사용하는 명령의 경우 데이터 버퍼가 커널에서 사용 중임에도 사용자 공간에서 해제되어 메모리 오염이나 데이터 손상이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터에서 사용 중인 저장 장치를 갑자기 뽑았을 때, 컴퓨터가 작업이 끝나기도 전에 메모리를 정리해버려 데이터가 깨지거나 오류가 생길 수 있는 문제입니다. 이로 인해 중요한 정보가 잘못 저장되거나 시스템 메모리가 엉망이 될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: sg: Allow waiting for commands to complete on removed device
When a SCSI device is removed while in active use, currently sg will
immediately return -ENODEV on any attempt to wait for active commands that
were sent before the removal. This is problematic for commands that use
SG_FLAG_DIRECT_IO since the data buffer may still be in use by the kernel
when userspace frees or reuses it after getting ENODEV, leading to
corrupted userspace memory (in the case of READ-type commands) or corrupted
data being sent to the device (in the case of WRITE-type commands). This
has been seen in practice when logging out of a iscsi_tcp session, where
the iSCSI driver may still be processing commands after the device has been
marked for removal.
Change the policy to allow userspace to wait for active sg commands even
when the device is being removed. Return -ENODEV only when there are no
more responses to read.
📍 영향받는 시스템
Linux kernel (SCSI sg driver를 사용하는 시스템)
⚔️ 공격 벡터
장치 제거 시 발생하는 레이스 컨디션을 이용한 메모리 오염 또는 데이터 손상 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인