🇰🇷 한글 설명
Linux 커널의 ipv6_find_hdr() 함수가 IPv6 확장 헤더 체인을 순회할 때, 헤더가 선언한 길이를 패킷 길이와 비교하지 않아 패킷 끝을 넘어서는 오프셋을 반환할 수 있습니다. 이로 인해 openvswitch에서 전송 계층 체크섬 처리 시 범위를 벗어난 메모리 읽기/쓰기(KASAN 보고된 slab-use-after-free)가 발생합니다. 패치는 선언된 길이가 패킷에 맞지 않는 헤더를 거부하도록 경계 검사를 추가합니다.
💡 쉬운 설명
악의적으로 조작된 IPv6 패킷이 커널의 메모리 경계를 벗어나 잘못된 위치를 읽고 쓰게 만들 수 있는 결함입니다. 커널 패치로 패킷 길이를 벗어나는 헤더를 거부하도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ipv6: do not let ipv6_find_hdr() return an offset past the packet end
ipv6_find_hdr() walks the extension header chain, skipping each header by
the length that header itself declares. ipv6_optlen() returns up to 2048,
and the skip is never checked against skb->len, so the offset stored in
*offset can point past the end of the packet.
openvswitch installs that offset as the transport header, and
update_ipv6_checksum() then reads and writes the transport checksum field
out of bounds:
BUG: KASAN: slab-use-after-free in inet_proto_csum_replace16+0x445/0x470
Read of size 2 at addr ffff88810b754b06 by task ovs_ipv6_oob/629
CPU: 4 UID: 1000 PID: 629 Comm: ovs_ipv6_oob Tainted: G N 7.3.0-rc3+ #348
Call Trace:
inet_proto_csum_replace16+0x445/0x470
set_ipv6_addr+0x3dd/0x460
do_execute_actions+0x6a3d/0x7c40
ovs_execute_actions+0xfd/0x480
ovs_packet_cmd_execute+0xc38/0xf20
genl_rcv_msg+0x59e/0x870
netlink_rcv_skb+0x18b/0x450
genl_rcv+0x2d/0x40
netlink_unicast+0x6bc/0xa20
The buggy address belongs to the object at ffff88810b754980
which belongs to the cache skbuff_small_head of size 704
The buggy address is located 390 bytes inside of
freed 704-byte region [ffff88810b754980, ffff88810b754c40)
Other callers use that offset too, so bound it here rather than in one
caller.
Reject a header whose declared length does not fit in the packet.
ipv6_find_hdr() already fails with -EBADMSG on a malformed chain, so this
adds no new failure mode.
📍 영향받는 시스템
패치 이전의 Linux 커널 (IPv6 및 openvswitch 모듈 사용 환경, 정확한 영향 버전은 해당 커널 배포판 보안 공지 확인 필요)
⚔️ 공격 벡터
원격지에서 조작된 IPv6 확장 헤더를 포함한 패킷을 전송하여 openvswitch 경로의 커널 메모리 손상을 유발하는 방식
🛡️ 대응 방법
배포판 제공 최신 커널로 업데이트하고 재부팅하거나, 필요 시 openvswitch 모듈 사용을 제한합니다.
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지의 패치된 버전과 비교하고, 해당 버전 이상이면 수정된 것이며 미만이면 업데이트가 필요합니다.
uname -r && (lsmod | grep -E 'openvswitch|ipv6' || echo 'modules not loaded')