🇰🇷 한글 설명
Linux 커널의 RDS InfiniBand 드라이버에서 연결이 완전히 설정되기 전에 FRWR 메모리 등록을 시도할 때 null 포인터 역참조로 인한 커널 크래시 취약점입니다. sendmsg() 호출 시 RDS_CMSG_RDMA_MAP 제어 메시지가 연결 초기화 전에 처리되면서 i_cm_id가 NULL인 상태에서 qp를 역참조합니다.
💡 쉬운 설명
Linux 커널의 RDS 네트워킹 기능에서 연결이 준비되지 않은 상태로 특정 메시지를 보내면 커널이 충돌합니다. 로컬 사용자가 의도적으로 이를 유발하여 서비스 거부 공격을 수행할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
rds: ib: reject FRMR registration before IB connection is established
rds_ib_get_mr() extracts the rds_ib_connection from conn->c_transport_data
and passes it to rds_ib_reg_frmr() for FRWR memory registration. On a
fresh outgoing connection, ic is allocated in rds_ib_conn_alloc() with
i_cm_id = NULL because the connection worker has not yet called
rds_ib_conn_path_connect() to create the rdma_cm_id. When sendmsg() with
RDS_CMSG_RDMA_MAP is called on such a connection, the sendmsg path parses
the control message before any connection establishment, allowing
rds_ib_post_reg_frmr() to dereference ic->i_cm_id->qp and crash the
kernel.
The existing guard in rds_ib_reg_frmr() only checks for !ic (added in
commit 9e630bcb7701), which does not catch this case since ic is allocated
early and is always non-NULL once the connection object exists.
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
RIP: 0010:rds_ib_post_reg_frmr+0x50e/0x920
Call Trace:
rds_ib_post_reg_frmr (net/rds/ib_frmr.c:167)
rds_ib_map_frmr (net/rds/ib_frmr.c:252)
rds_ib_reg_frmr (net/rds/ib_frmr.c:430)
rds_ib_get_mr (net/rds/ib_rdma.c:615)
__rds_rdma_map (net/rds/rdma.c:295)
rds_cmsg_rdma_map (net/rds/rdma.c:860)
rds_sendmsg (net/rds/send.c:1363)
____sys_sendmsg
do_syscall_64
Add a check in rds_ib_get_mr() that verifies ic, i_cm_id, and qp are all
non-NULL before proceeding with FRMR registration, mirroring the guard
already present in rds_ib_post_inv(). Return -ENODEV when the connection
is not ready, which the existing error handling in rds_cmsg_send() converts
to -EAGAIN for userspace retry and triggers rds_conn_connect_if_down() to
start the connection worker.
📍 영향받는 시스템
Linux kernel RDS (net/rds) InfiniBand 드라이버, 영향 버전은 CVE 설명 기반 특정 버전 확인 필요
⚔️ 공격 벡터
로컬 인증된 사용자가 sendmsg() 시스템 콜로 RDS_CMSG_RDMA_MAP 제어 메시지를 미연결 상태의 소켓에 전송
🛡️ 대응 방법
Linux 커널을 최신 패치 버전으로 업데이트하여 rds_ib_get_mr() 함수의 연결 상태 검증 로직을 적용
🔧 검증 코드
현재 커널 버전을 확인한 후 rds_ib_get_mr() 함수 존재 여부로 RDS 드라이버 탑재 확인, 패치 적용 여부는 kernel changelogs에서 해당 CVE 수정 커밋 포함 여부로 검증
uname -r && grep -r 'rds_ib_get_mr' /usr/src/linux*/net/rds/ 2>/dev/null | head -1