🇰🇷 한글 설명
Linux 커널의 netfilter 구성 요소 중 nft_ct 모듈에서 템플릿 커넥션 추적(ct)을 처리할 때 발생하는 취약점입니다. 특정 nftables 규칙을 사용할 경우 커널 스택에서 메모리 오버플로가 발생하여 시스템 안정성을 해치거나 권한 상승을 유발할 수 있습니다.
💡 쉬운 설명
리눅스 네트워크 관리 도구의 특정 설정 오류를 이용해 컴퓨터의 핵심 메모리 영역을 넘쳐흐르게 만드는 버그입니다. 이를 통해 해커가 시스템의 제어권을 뺏거나 컴퓨터를 멈추게 할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nft_ct: bail out on template ct in get eval
I noticed this issue while looking at a historic syzbot report [1].
A rule like the one below is enough to trigger the bug:
table ip t {
chain pre {
type filter hook prerouting priority raw;
ct zone set 1
ct original saddr 1.2.3.4 accept
}
}
The first expression attaches a per-cpu template ct via
nft_ct_set_zone_eval() (nf_ct_tmpl_alloc -> kzalloc, tuple is all
zero, nf_ct_l3num(ct) == 0). The next expression then calls
nft_ct_get_eval() on the same skb, treats the template as a real ct
and hits the 16-byte memcpy path. With dreg at NFT_REG32_15 this
overflows past struct nft_regs on the kernel stack; with smaller
dreg values it silently clobbers adjacent registers.
Reject template ct at the eval entry and in nft_ct_get_fast_eval(),
mirroring the check nft_ct_set_eval() already has. Additionally,
bound the address copy in NFT_CT_SRC / NFT_CT_DST by priv->len
instead of by nf_ct_l3num(ct): nf_ct_get_tuple() zeroes the tuple
before pkt_to_tuple() fills in only the protocol-relevant leading
bytes, so the trailing bytes of tuple->{src,dst}.u3.all are
well-defined zero. priv->len is validated at rule load, so the
copy size is now bounded by the destination register rather than
by an untrusted field on the conntrack.
[1]: https://syzkaller.appspot.com/bug?id=389cf09cb72926114fce90dc85a2c3231dcb647c
📍 영향받는 시스템
Linux kernel (netfilter/nftables component)
⚔️ 공격 벡터
특정 구조를 가진 nftables 규칙을 로드하여 커널 스택 메모리 오버플로 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인