🇰🇷 한글 설명
Linux 커널의 RDMA/rxe 드라이버에서 정의되지 않은 Opcode를 처리할 때 발생하는 Out-of-Bounds Read 취약점입니다. 공격자가 특수하게 조작된 단일 UDP 패킷을 전송하면 커널의 CRC32 계산 과정에서 언더플로우가 발생하여 시스템 패닉(Panic)을 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터가 알 수 없는 명령어를 받았을 때 이를 제대로 검사하지 못해 발생하는 오류입니다. 해커가 가짜 명령어가 담긴 데이터 패킷을 보내면 컴퓨터 시스템이 갑자기 멈추거나 꺼질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
RDMA/rxe: Reject unknown opcodes before ICRC processing
Even after applying commit 7244491dab34 ("RDMA/rxe: Validate pad and ICRC
before payload_size() in rxe_rcv"), a single unauthenticated UDP packet
can still trigger panic. That patch handled payload_size() underflow only
for valid opcodes with short packets, not for packets carrying an unknown
opcode. The unknown-opcode OOB read described below predates that commit
and reaches back to the initial Soft RoCE driver.
The check added there reads
pkt->paylen < header_size(pkt) + bth_pad(pkt) + RXE_ICRC_SIZE
where header_size(pkt) expands to rxe_opcode[pkt->opcode].length. The
rxe_opcode[] array has 256 entries but is only populated for defined IB
opcodes; any other entry (for example opcode 0xff) is zero-initialized, so
length == 0 and the check degenerates to
pkt->paylen < 0 + bth_pad(pkt) + RXE_ICRC_SIZE
which does not constrain pkt->paylen enough. rxe_icrc_hdr() then computes
rxe_opcode[pkt->opcode].length - RXE_BTH_BYTES
which underflows when length == 0 and passes a huge value to rxe_crc32(),
causing an out-of-bounds read of the skb payload.
Reproduced on v7.0-rc7 with that fix applied, QEMU/KVM with
CONFIG_RDMA_RXE=y and CONFIG_KASAN=y, after
rdma link add rxe0 type rxe netdev eth0
A single 48-byte UDP packet to port 4791 with BTH opcode=0xff and
QPN=IB_MULTICAST_QPN triggers:
BUG: KASAN: slab-out-of-bounds in crc32_le+0x115/0x170
Read of size 1 at addr ...
The buggy address is located 0 bytes to the right of
allocated 704-byte region
Call Trace:
crc32_le+0x115/0x170
rxe_icrc_hdr.isra.0+0x226/0x300
rxe_icrc_check+0x13f/0x3a0
rxe_rcv+0x6e1/0x16e0
rxe_udp_encap_recv+0x20a/0x320
udp_queue_rcv_one_skb+0x7ed/0x12c0
Subsequent packets with the same shape fault on unmapped memory and panic
the kernel. The trigger requires only module load and "rdma link add"; no
QP, no connection, and no authentication.
Fix this by rejecting packets whose opcode has no rxe_opcode[] entry,
detected via the zero mask or zero length, before any length arithmetic
runs.
📍 영향받는 시스템
CONFIG_RDMA_RXE=y 설정이 활성화된 Linux 커널 (v7.0-rc7 및 이전 버전 포함)
⚔️ 공격 벡터
인증되지 않은 공격자가 포트 4791로 조작된 BTH Opcode(예: 0xff)를 포함한 UDP 패킷을 전송
🛡️ 대응 방법
커널 패치를 적용하여 Opcode 검증 단계에서 정의되지 않은 Opcode를 즉시 거부하도록 업데이트
🔧 검증 코드
명령어 결과에 CONFIG_RDMA_RXE=y가 포함되어 있다면 해당 취약점에 노출될 가능성이 있는 환경입니다.
uname -r && zgrep -E 'CONFIG_RDMA_RXE=y' /proc/config.gz 2>/dev/null || grep -E 'CONFIG_RDMA_RXE=y' /boot/config-$(uname -r)