🇰🇷 한글 설명
Linux 커널의 batman-adv 모듈에서 VLAN 정보를 처리할 때 발생하는 TOCTOU(Time-of-Check to Time-of-Use) 레이스 컨디션 취약점입니다. VLAN 개수를 확인하여 버퍼를 할당한 후 실제 데이터를 채우는 과정에서, 할당된 크기보다 더 많은 VLAN 정보가 유입되어 메모리 오버플로우가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 데이터를 담을 그릇의 크기를 미리 계산해서 준비하는데, 그 사이에 데이터가 갑자기 늘어나서 그릇이 넘쳐버리는 문제입니다. 이로 인해 시스템이 불안정해지거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
batman-adv: tt: fix TOCTOU race for reported vlans
The local TT based TVLV is generated by first checking the number of VLANs
which have at least one TT entry. A new buffer with the correct size for
the VLANs is then allocated. Only then, the list of VLANs s used to fill
the VLAN entries in the buffer. During this time, the meshif_vlan_list_lock
is held. But the actual number of TT entries of each VLAN can still
increase during this time - just not the number of VLANs in the list.
But the prefilter used in the buffer size calculation might still cause an
increase of the number of VLANs which need to be stored. Simply because a
VLAN might now suddenly have at least one entry when it had none in the
pre-alloc check - and then needs to occupy space which was not allocated.
It is better to overestimate the buffer size at the beginning and then fill
the buffer only with the VLANs which are not empty.
📍 영향받는 시스템
Linux kernel (batman-adv 모듈을 사용하는 시스템)
⚔️ 공격 벡터
로컬 시스템에서 특정 타이밍에 VLAN 엔트리를 급격히 증가시켜 메모리 오버플로우 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이상인지 확인