🇰🇷 한글 설명
Linux 커널의 RDMA/rtrs-srv 구성 요소에서 RDMA-Write 길이를 청크 크기에 제한하지 않아 발생하는 취약점입니다. 공격자가 조작된 길이를 전송할 경우, 할당된 메모리 범위를 벗어나 인접한 호스트 메모리를 읽어 정보가 유출될 수 있습니다.
💡 쉬운 설명
네트워크를 통해 데이터를 주고받을 때, 상대방이 정해진 크기보다 더 많은 데이터를 달라고 요청하여 컴퓨터의 비밀 정보를 훔쳐갈 수 있는 문제입니다. 공격자가 데이터 크기를 속여서 허용된 영역 밖의 메모리까지 읽어가는 방식입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
RDMA/rtrs-srv: Bound RDMA-Write length to chunk size in rdma_write_sg
When the server answers an RTRS READ, rdma_write_sg() builds the source
scatter/gather entry for the IB_WR_RDMA_WRITE that returns data to the
peer. Its length is taken directly from the wire descriptor:
plist->length = le32_to_cpu(id->rd_msg->desc[0].len);
rd_msg points into the chunk buffer that the remote peer filled via
RDMA-WRITE-WITH-IMM (rtrs_srv_rdma_done() -> process_io_req() ->
process_read()), so desc[0].len is attacker-controlled and, before this
change, was only rejected when zero. The source address is the fixed
chunk start (dma_addr[msg_id]) and the source lkey is the PD-wide
local_dma_lkey, which is not tied to the chunk's MR mapping, so the verbs
layer does not constrain the transfer length to max_chunk_size. msg_id
and off are bounded against queue_depth and max_chunk_size in
rtrs_srv_rdma_done(), but desc[0].len is a separate field that was not
checked against the chunk size.
A peer that advertises desc[0].len larger than max_chunk_size can make
the posted RDMA write read past the chunk's mapped region. The resulting
behaviour depends on the IOMMU configuration: with no IOMMU or in
passthrough mode the read may extend into memory adjacent to the chunk
and be returned to the peer, which can disclose host memory; with a
translating IOMMU the out-of-range access is expected to fault and abort
the connection. In either case the transfer exceeds what the protocol
permits and is driven by a remote peer.
Reject a descriptor length above max_chunk_size, mirroring the existing
off >= max_chunk_size bound in rtrs_srv_rdma_done(). Legitimate clients
do not exceed it: the client sets desc[0].len to its MR length, which is
capped at the negotiated max_io_size (max_chunk_size - MAX_HDR_SIZE).
📍 영향받는 시스템
Linux kernel (RDMA/rtrs-srv 모듈 사용 시스템)
⚔️ 공격 벡터
네트워크를 통해 조작된 RDMA descriptor 길이를 전송하여 메모리 경계를 초과하는 읽기 요청 수행
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 RDMA descriptor 길이에 대한 검증 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인