🇰🇷 한글 설명
Linux 커널의 RDMA/srp 구성 요소에서 발생한 취약점으로, 잘린 SRP_CRED_REQ 요청을 처리할 때 힙 메모리의 정보가 유출될 수 있습니다. 공격자가 의도적으로 짧은 요청을 보내면 커널은 버퍼 범위를 벗어난 데이터를 읽어 응답에 포함시켜 전송하게 됩니다.
💡 쉬운 설명
컴퓨터 메모리의 경계를 넘어서 데이터를 읽는 실수로 인해, 시스템 내부의 민감한 정보가 외부로 유출될 수 있는 문제입니다. 공격자가 조작된 짧은 메시지를 보내면 시스템이 실수로 옆에 있는 다른 데이터를 읽어서 돌려주게 됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
RDMA/srp: fix heap information leak on a truncated SRP_CRED_REQ
srp_recv_done() passes wc->byte_len to srp_process_rsp(). It passes
nothing to srp_process_cred_req() and srp_process_aer_req(), which read
fixed-size fields from the receive buffer without checking that those
fields were received.
The buffer size is max_ti_iu_len, which comes from the login response
and is not validated. A target that advertises 8 and then sends an
8-byte SRP_CRED_REQ makes the initiator read req->tag from beyond the
end of the buffer. req->tag is copied into the SRP_CRED_RSP and sent
back, so those bytes reach the target. SRP_AER_REQ behaves the same way
and also reads req->lun.
The leak is 8 bytes per response. max_ti_iu_len also decides which slab
cache the buffer comes from. With 8 the buffer is a kmalloc-8 object and
the read is entirely outside it:
BUG: KASAN: slab-out-of-bounds in srp_recv_done+0x172b/0x1aa0
Read of size 8 at addr ffff888104714da8 by task kworker/u8:3/50
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes to the right of
allocated 8-byte region [ffff888104714da0, ffff888104714da8)
Without KASAN the returned bytes are whatever is next in the slab. One
run returned ".strtab".
rsp->data[3] in srp_process_rsp() has the same problem: only
resp_data_len is checked before it is read.
Drop a request that is shorter than the structure being parsed, and
check byte_len before the tsk_mgmt read.
📍 영향받는 시스템
Linux Kernel (RDMA/srp 모듈 사용 환경)
⚔️ 공격 벡터
네트워크를 통해 조작된 크기의 짧은 SRP_CRED_REQ 또는 SRP_AER_REQ 패킷을 전송
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 요청 길이에 대한 검증 로직을 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인