🇰🇷 한글 설명
Linux 커널의 ksmbd(SMB 서버)에서 복합 요청(READ + QUERY_INFO) 처리 시 버퍼 오버플로우 취약점이 발생합니다. 첫 번째 명령이 응답 버퍼를 대부분 사용할 때, 보안 descriptor 생성 중 할당된 버퍼를 초과하여 쓰기 작업이 수행될 수 있습니다.
💡 쉬운 설명
SMB 파일 서버(Linux)에서 특정 파일 요청을 연달아 보낼 때 메모리 보호 영역을 침범하는 버그입니다. 공격자가 이를 악용하면 시스템을 제어하거나 데이터를 손상시킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix OOB write in QUERY_INFO for compound requests
When a compound request such as READ + QUERY_INFO(Security) is received,
and the first command (READ) consumes most of the response buffer,
ksmbd could write beyond the allocated buffer while building a security
descriptor.
The root cause was that smb2_get_info_sec() checked buffer space using
ppntsd_size from xattr, while build_sec_desc() often synthesized a
significantly larger descriptor from POSIX ACLs.
This patch introduces smb_acl_sec_desc_scratch_len() to accurately
compute the final descriptor size beforehand, performs proper buffer
checking with smb2_calc_max_out_buf_len(), and uses exact-sized
allocation + iov pinning.
📍 영향받는 시스템
Linux kernel ksmbd(CONFIG_SMB_SERVER) 사용 시스템, 특히 커널 6.x 버전
⚔️ 공격 벡터
SMB(포트 445) 프로토콜을 통한 원격 복합 요청 전송
🛡️ 대응 방법
Linux kernel을 최신 버전으로 업데이트하여 ksmbd 패치 적용
🔧 검증 코드
'ksmbd enabled' 출력 시 취약점 영향 대상이며, 커널 업데이트 필요
grep CONFIG_SMB_SERVER /boot/config-$(uname -r) | grep -q 'y' && echo 'ksmbd enabled' || echo 'ksmbd disabled'