🇰🇷 한글 설명
Linux kernel의 ksmbd 모듈에서 unsigned 정수값을 signed int로 잘못 캐스팅하여 발생하는 정수 언더플로우 취약점입니다. 공격자가 SMB Direct 협상 단계에서 preferred_send_size를 0x80000000으로 조작하면 min_t() 함수에서 잘못된 비교가 발생하고, 이를 통해 힙 버퍼 오버플로우를 유발할 수 있습니다.
💡 쉬운 설명
Linux 파일 공유 프로토콜(SMB)의 메모리 크기 검증 버그로, 공격자가 특정 값을 보내 시스템 메모리를 손상시킬 수 있습니다. 원격 공격자가 네트워크를 통해 악용할 수 있어 매우 위험합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix signededness bug in smb_direct_prepare_negotiation()
smb_direct_prepare_negotiation() casts an unsigned __u32 value
from sp->max_recv_size and req->preferred_send_size to a signed
int before computing min_t(int, ...). A maliciously provided
preferred_send_size of 0x80000000 will return as smaller than
max_recv_size, and then be used to set the maximum allowed
alowed receive size for the next message.
By sending a second message with a large value (>1420 bytes)
the attacker can then achieve a heap buffer overflow.
This fix replaces min_t(int, ...) with min_t(u32)
📍 영향받는 시스템
Linux kernel의 ksmbd 모듈이 활성화된 모든 버전 (패치 적용 전)
⚔️ 공격 벡터
SMB Direct 프로토콜 협상 단계에서 공격자가 preferred_send_size를 악의적으로 조작한 후 1420바이트 이상의 메시지를 전송
🛡️ 대응 방법
Linux kernel을 패치 버전으로 업그레이드하거나 min_t(int, ...) 코드가 min_t(u32, ...)로 수정된 버전 적용
🔧 검증 코드
패치가 적용된 경우 min_t(u32, ...)가 포함된 라인이 표시되고, 패치되지 않은 경우 min_t(int, ...)만 보임
grep -n 'min_t(u32' $(find /usr/src -name '*.c' 2>/dev/null | xargs grep -l 'smb_direct_prepare_negotiation' 2>/dev/null | head -1) 2>/dev/null || echo 'ksmbd source not found'