🇰🇷 한글 설명
Linux 커널의 BFA SCSI 드라이버에서 userspace로부터 복사된 버퍼가 NUL 종료 문자 없이 할당되어 sscanf 사용 시 경계 밖 메모리 읽기(OOB)가 발생할 수 있습니다. memdup_user 대신 memdup_user_nul을 사용하여 버퍼에 NUL 종료를 보장함으로써 수정되었습니다.
💡 쉬운 설명
Linux 커널의 BFA 드라이버가 사용자로부터 받은 데이터를 제대로 마무리하지 않아 메모리를 잘못 읽을 수 있습니다. 로컬 사용자가 이를 악용해 커널 정보를 유출하거나 시스템을 불안정하게 만들 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: bfa: Ensure the copied buf is NUL terminated
Currently, we allocate a nbytes-sized kernel buffer and copy nbytes from
userspace to that buffer. Later, we use sscanf on this buffer but we don't
ensure that the string is terminated inside the buffer, this can lead to
OOB read when using sscanf. Fix this issue by using memdup_user_nul instead
of memdup_user.
📍 영향받는 시스템
패치 이전의 Linux 커널 (BFA SCSI 드라이버 포함, 일반적으로 5.15.x 이전 버전)
⚔️ 공격 벡터
로컬 사용자가 /sys/class 또는 관련 sysfs 인터페이스를 통해 sscanf 오버플로우를 트리거할 수 있습니다.
🛡️ 대응 방법
Linux 커널을 memdup_user_nul 패치가 적용된 최신 버전으로 업데이트하세요.
🔧 검증 코드
커널 버전이 표시되고 memdup_user_nul이 검색되면 패치가 적용된 상태입니다. 결과가 없으면 취약한 버전입니다.
uname -r && grep -r memdup_user_nul /lib/modules/$(uname -r)/kernel/drivers/scsi/bfa/ 2>/dev/null | head -1