🇰🇷 한글 설명
Linux 커널의 BPF flow dissector(bpf_flow_dissect)에서 hlen 값을 clamp_t(u16, ...)로 처리할 때 65535를 초과하면 u16 절삭이 발생해 nhoff와 thoff가 0으로 강제될 수 있습니다. 이는 이전에 수정된 skb->len 절삭 문제와 동일한 계열이며, 수정은 clamp 전에 hlen을 U16_MAX로 제한하는 방식입니다.
💡 쉬운 설명
커널이 패킷 헤더 위치를 계산할 때 큰 길이 값이 잘못 줄어들어 위치가 0으로 잘못 설정될 수 있습니다. 이 때문에 패킷 분석 결과가 틀어질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
flow_dissector: avoid u16 truncation of hlen in bpf_flow_dissect()
bpf_flow_dissect() sanitizes the offsets returned by the BPF program
with clamp_t(u16, ..., hlen).
If hlen is bigger than 65535, the upper bound is truncated before
the comparison. For instance, with hlen == 65536, both nhoff and
thoff are forced to zero, even if the program returned sane values.
This is the same class of bug as the one fixed in commit 99bda1ecbd56
("flow_dissector: avoid u16 truncation of skb->len when computing
thoff"). That fix does not cover the BPF path, because
__skb_flow_dissect() returns early when a BPF flow dissector
handles the packet.
struct bpf_flow_keys stores nhoff and thoff as u16, so cap hlen
to U16_MAX before clamping.
Found by sashiko while reviewing the commit above.
📍 영향받는 시스템
패치가 적용되지 않은 Linux 커널 (BPF flow dissector 사용 환경)
⚔️ 공격 벡터
매우 큰 hlen 값을 갖는 패킷을 BPF flow dissector가 처리하는 경로를 통해 잘못된 헤더 오프셋을 유발하는 방식으로 알려져 있으며, 구체적인 악용 사례는 확인되지 않았습니다.
🛡️ 대응 방법
최신 Linux 커널 업데이트를 적용하여 해당 수정 커밋이 포함된 버전으로 재부팅하세요.
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지 또는 upstream 수정 커밋 포함 여부와 비교하여, 해당 수정이 포함된 이후 버전이면 패치된 것입니다.