🇰🇷 한글 설명
Linux 커널 libceph의 ceph_monmap_decode() 함수에서 정수 타입 변환 오류로 인한 취약점입니다. 음수가 아닌 값을 다루는 변수가 signed int로 선언되어 있어, 악의적인 monmap 메시지로 인해 메모리 할당 검증을 우회하고 시스템 메모리 고갈을 유발할 수 있습니다.
💡 쉬운 설명
Linux 커널의 Ceph 네트워크 통신에서 숫자를 잘못 해석하는 버그입니다. 공격자가 특수한 메시지를 보내면 시스템이 막대한 메모리를 할당하려고 시도하여 시스템이 응답 불가 상태가 될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
libceph: Use u32 for non-negative values in ceph_monmap_decode()
This patch fixes unnecessary implicit conversions that change signedness
of blob_len and num_mon in ceph_monmap_decode().
Currently blob_len and num_mon are (signed) int variables. They are used
to hold values that are always non-negative and get assigned in
ceph_decode_32_safe(), which is meant to assign u32 values. Both
variables are subsequently used as unsigned values, and the value of
num_mon is further assigned to monmap->num_mon, which is of type u32.
Therefore, both variables should be of type u32. This is especially
relevant for num_mon. If the value read from the incoming message is
very large, it is interpreted as a negative value, and the check for
num_mon > CEPH_MAX_MON does not catch it. This leads to the attempt to
allocate a very large chunk of memory for monmap, which will most likely
fail. In this case, an unnecessary attempt to allocate memory is
performed, and -ENOMEM is returned instead of -EINVAL.
📍 영향받는 시스템
Linux kernel libceph (Ceph 클라이언트 라이브러리) - 패치 적용 전 모든 버전
⚔️ 공격 벡터
네트워크 상의 공격자가 악의적으로 조작된 Ceph monitor map 메시지를 전송하여 원격에서 DoS 공격 수행 가능
🛡️ 대응 방법
Linux 커널을 최신 버전으로 업데이트하여 ceph_monmap_decode() 함수의 타입 수정사항(int→u32) 적용
🔧 검증 코드
blob_len과 num_mon이 u32로 선언되면 패치됨, int로 선언되면 취약함
uname -r && grep -A 5 'ceph_monmap_decode' /usr/src/linux-headers-$(uname -r)/net/ceph/decode.h 2>/dev/null | grep -E 'u32|int' | head -3