🇰🇷 한글 설명
Linux 커널의 batman-adv 모듈에서 TVLV 패킷 크기를 계산할 때 정수 오버플로가 발생할 수 있는 취약점입니다. 누적된 크기가 u16 범위를 초과하면 값이 되돌아가(wrap around) 실제보다 작은 메모리가 할당되며, 이로 인해 커널 메모리 오염이 발생할 수 있습니다.
💡 쉬운 설명
데이터의 전체 크기를 계산하는 과정에서 숫자가 너무 커져서 오히려 아주 작은 숫자로 잘못 인식되는 오류가 있습니다. 이로 인해 준비된 공간보다 더 많은 데이터를 억지로 집어넣으려다 시스템의 중요한 메모리 영역을 망가뜨릴 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
batman-adv: tvlv: reject oversized TVLV packets
batadv_tvlv_container_ogm_append() builds a TVLV packet section from
the tvlv.container_list. The total size of this section is computed by
batadv_tvlv_container_list_size(), which sums the sizes of all registered
containers.
The return type and accumulator in batadv_tvlv_container_list_size() were
u16. If the accumulated size exceeds U16_MAX, the value wraps around,
causing the subsequent allocation in batadv_tvlv_container_ogm_append()
to be undersized. The memcpy-style copy that follows would then write
beyond the end of the allocated buffer, corrupting kernel memory.
Fix this by widening the return type of batadv_tvlv_container_list_size()
to size_t. In batadv_tvlv_container_ogm_append(), check the computed length
against U16_MAX before proceeding, and bail out as if the allocation had
failed when the limit is exceeded.
📍 영향받는 시스템
Linux kernel (batman-adv 모듈 사용 환경)
⚔️ 공격 벡터
조작된 대형 TVLV 패킷을 전송하여 커널 메모리 오버플로 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인