🇰🇷 한글 설명
Linux 커널의 IPv6 Segment Routing 구현에서 SEG6_ATTR_DST 속성의 길이 검증이 미흡하여 발생하는 취약점입니다. 공격자가 짧은 길이의 속성을 전송할 경우, 커널 메모리의 초기화되지 않은 16바이트 데이터가 읽혀 사용자 공간으로 유출될 수 있습니다.
💡 쉬운 설명
리눅스 시스템의 네트워크 처리 과정에서 데이터의 길이를 정확히 확인하지 않아 발생하는 문제입니다. 이를 통해 해커가 컴퓨터 내부의 중요한 비밀 정보가 담긴 메모리 일부를 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ipv6: sr: enforce exact attribute length for SEG6_ATTR_DST
In seg6_genl_policy, SEG6_ATTR_DST is defined with .type = NLA_BINARY and
.len = sizeof(struct in6_addr). For NLA_BINARY, .len only enforces the
maximum payload length and permits shorter payloads (e.g., 0 bytes).
When seg6_genl_set_tunsrc() copies sizeof(struct in6_addr) bytes via
kmemdup(val, sizeof(*val), GFP_KERNEL), a short SEG6_ATTR_DST attribute
triggers a 16-byte out-of-bounds read past skb->tail into uninitialized
skb->head memory, which is stored in sdata->tun_src and leaked back to
userspace via SEG6_CMD_GET_TUNSRC.
Switch SEG6_ATTR_DST in seg6_genl_policy to
NLA_POLICY_EXACT_LEN(sizeof(struct in6_addr)) so that generic netlink
validation rejects any attribute whose length is not exactly
sizeof(struct in6_addr) with -ERANGE.
Tested in QEMU against Linux 7.3.0-rc3 by sending a SEG6_CMD_SET_TUNSRC
Generic Netlink message with a 0-byte SEG6_ATTR_DST attribute followed
by SEG6_CMD_GET_TUNSRC. On the unfixed kernel, SEG6_CMD_SET_TUNSRC
succeeds (err = 0) and SEG6_CMD_GET_TUNSRC leaks 16 bytes of
uninitialized kernel heap memory (tun_src =
836a61ecc4d25a1042a8d60411cfb378); with this patch applied,
SEG6_CMD_SET_TUNSRC is rejected by netlink policy validation with
-ERANGE (-34) and tun_src remains zeroed.
📍 영향받는 시스템
Linux kernel 7.3.0-rc3 및 해당 기능이 포함된 이전 버전
⚔️ 공격 벡터
조작된 SEG6_CMD_SET_TUNSRC Generic Netlink 메시지를 전송하여 커널 메모리 유출 유도
🛡️ 대응 방법
SEG6_ATTR_DST 정책을 NLA_POLICY_EXACT_LEN으로 변경하여 정확한 길이 검증 적용
🔧 검증 코드
출력된 커널 버전이 보안 패치가 적용된 최신 버전인지 확인하십시오.