🇰🇷 한글 설명
Linux 커널의 SCSI target_core_configfs 구성 요소에서 버퍼 오버플로우 취약점이 발견되었습니다. target_lu_gp_members_show 함수 내에서 snprintf의 반환값을 적절히 검증하지 않아, 생성된 문자열이 할당된 버퍼 크기(256바이트)를 초과할 경우 memcpy 과정에서 오버플로우가 발생할 수 있습니다.
💡 쉬운 설명
데이터를 저장하는 바구니의 크기보다 더 큰 데이터를 넣으려고 시도할 때 발생하는 오류입니다. 공격자가 특수하게 조작된 이름을 사용하여 시스템의 메모리 영역을 넘치게 만들어 오류를 일으키거나 보안 문제를 유발할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: target: target_core_configfs: Add length check to avoid buffer overflow
A buffer overflow arises from the usage of snprintf to write into the
buffer "buf" in target_lu_gp_members_show function located in
/drivers/target/target_core_configfs.c. This buffer is allocated with
size LU_GROUP_NAME_BUF (256 bytes).
snprintf(...) formats multiple strings into buf with the HBA name
(hba->hba_group.cg_item), a slash character, a devicename (dev->
dev_group.cg_item) and a newline character, the total formatted string
length may exceed the buffer size of 256 bytes.
Since snprintf() returns the total number of bytes that would have been
written (the length of %s/%sn ), this value may exceed the buffer length
(256 bytes) passed to memcpy(), this will ultimately cause function
memcpy reporting a buffer overflow error.
An additional check of the return value of snprintf() can avoid this
buffer overflow.
📍 영향받는 시스템
Linux Kernel (scsi: target: target_core_configfs 모듈 사용 시스템)
⚔️ 공격 벡터
조작된 HBA 이름 또는 디바이스 이름을 통해 버퍼 크기를 초과하는 문자열을 생성하여 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 snprintf 반환값 검증 로직을 적용해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인