🇰🇷 한글 설명
Linux 커널의 netfilter nft_set_pipapo 모듈에서 pipapo_drop() 함수가 스택 할당 배열의 경계를 벗어나 4바이트를 읽는 취약점. 마지막 반복에서 rulemap[i + 1].n이 배열 끝을 초과하는 주소에 접근합니다.
💡 쉬운 설명
Linux 시스템의 네트워크 필터링 기능에서 허가되지 않은 메모리 영역을 읽으려는 문제입니다. 시스템 정보 유출 또는 커널 패닉을 야기할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nft_set_pipapo: fix stack out-of-bounds read in pipapo_drop()
pipapo_drop() passes rulemap[i + 1].n to pipapo_unmap() as the
to_offset argument on every iteration, including the last one where
i == m->field_count - 1. This reads one element past the end of the
stack-allocated rulemap array (declared as rulemap[NFT_PIPAPO_MAX_FIELDS]
with NFT_PIPAPO_MAX_FIELDS == 16).
Although pipapo_unmap() returns early when is_last is true without
using the to_offset value, the argument is evaluated at the call site
before the function body executes, making this a genuine out-of-bounds
stack read confirmed by KASAN:
BUG: KASAN: stack-out-of-bounds in pipapo_drop+0x50c/0x57c [nf_tables]
Read of size 4 at addr ffff8000810e71a4
This frame has 1 object:
[32, 160) 'rulemap'
The buggy address is at offset 164 -- exactly 4 bytes past the end
of the rulemap array.
Pass 0 instead of rulemap[i + 1].n on the last iteration to avoid
the out-of-bounds read.
📍 영향받는 시스템
Linux 커널 6.x 버전에서 netfilter nft_set_pipapo 모듈을 사용하는 모든 시스템
⚔️ 공격 벡터
로컬 권한 있는 사용자가 netfilter 규칙을 삭제하는 특정 작업을 트리거할 때 발생
🛡️ 대응 방법
Linux 커널을 최신 패치 버전으로 업데이트하여 pipapo_drop() 함수의 수정사항 적용
🔧 검증 코드
커널 버전 확인 후 nf_tables 모듈이 로드된 상태에서 uname 버전이 패치된 커널 버전 이상이면 취약점이 수정된 것입니다
uname -r && modinfo nf_tables 2>/dev/null | grep filename || echo 'netfilter module not loaded'