🇰🇷 한글 설명
Linux 커널의 RDS(Reliable Datagram Sockets) RDMA CM 이벤트 핸들러에서 InfiniBand가 아닌 장치(예: iWARP RNIC인 siw)를 사용할 때 transport 포인터가 초기화되지 않은 채 역참조되어 커널 크래시가 발생하는 문제입니다. 수정으로 transport를 InfiniBand로 고정하고, 비-IB 장치의 연결 요청은 거부하며, 비-IB 주소로 해석된 연결은 경로 해석 없이 드롭합니다.
💡 쉬운 설명
RDS 네트워크 기능을 iWARP 장치에서 연결 요청이 오면 리눅스 커널이 초기화되지 않은 값을 사용해 멈출 수 있습니다. 이 문제는 InfiniBand만 지원하도록 정리하여 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: rds: fix uninitialized trans dereference in CM event handler
rds_rdma_cm_event_handler_cmn() assigns trans only when the RDMA
device is an InfiniBand CA (RDMA_NODE_IB_CA). On any other device
type, e.g. an iWARP RNIC such as siw, trans stays uninitialized, but
the event switch dereferences it: unconditionally in the
RDMA_CM_EVENT_CONNECT_REQUEST case via trans->cm_handle_connect(),
and (with a connection context) in the ROUTE_RESOLVED and
ESTABLISHED cases.
An RDS listener on an iWARP device therefore crashes the kernel as
soon as a connect request arrives: with CONFIG_INIT_STACK_ALL_ZERO
the wild load becomes a NULL dereference at offset 0xa0
(&trans->cm_handle_connect) in the iw_cm_wq workqueue.
GCC masks the bug in default builds by folding the uninitialized
load into &rds_ib_transport; Clang-built kernels take the real
uninitialized path and oops.
The active side can land on a non-IB device too: the id that
rds_ib_conn_path_connect() creates is not restricted to a node type,
so rdma_resolve_addr() binds it to whichever device serves the local
address, and an iWARP RNIC on the same netdev qualifies. The crash
there is different: resolving a route on an iWARP id never fills in
cm_id->route.path_rec, and the ROUTE_RESOLVED case writes
path_rec[0].sl before it calls into the transport.
The iWARP transport was dropped long ago and IB is the only
transport left, so make that explicit: initialize trans to
&rds_ib_transport at declaration, drop the conditional assignment,
reject a connect request that arrives on a non-IB device, and drop a
connection whose address resolved to one instead of resolving a
route on it. The rejection is limited to RDMA_CM_EVENT_CONNECT_REQUEST
on purpose: a non-zero return from the handler makes rdma_cm destroy
the id the event was delivered on, which is right for the request's
freshly created id but would free a connection id that RDS still owns
for any other event. On the active side the id stays ic->i_cm_id and
the connection's shutdown destroys it, so that case returns 0.
[achender: reject only on RDMA_CM_EVENT_CONNECT_REQUEST instead of
bailing out for every event on a non-IB device, so that rdma_cm does
not destroy connection ids RDS still tracks; drop a connection whose
address resolved to a non-IB device before a route is resolved on it;
changelog adjusted]
📍 영향받는 시스템
RDS 모듈을 사용하는 수정 전 Linux 커널 (iWARP 장치 사용 환경, 특히 Clang 빌드 커널)
⚔️ 공격 벡터
iWARP RNIC 등 비-InfiniBand 장치에 RDS 리스너를 두고 원격에서 연결 요청을 보내 커널 패닉(서비스 거부)을 유발
🛡️ 대응 방법
패치된 최신 Linux 커널로 업데이트하거나 배포판의 보안 업데이트를 적용하고, 불필요하면 rds 모듈을 비활성화(blacklist)
🔧 검증 코드
커널 버전이 배포판 보안 권고의 패치 버전 이상이면 수정된 것이며, rds 모듈이 로드되지 않았다면 이 취약점의 영향을 받지 않습니다.
uname -r; lsmod | grep -w rds; modinfo rds 2>/dev/null | grep -i version