🇰🇷 한글 설명
Linux 커널의 SUNRPC 구성 요소에서 CREDS_VALUE 옵션이 중복될 경우 발생하는 메모리 누수 취약점입니다. 중복된 옵션이 들어오면 기존에 할당된 그룹 정보 포인터를 해제하지 않고 새로운 포인터로 덮어쓰기 때문에, 첫 번째 할당된 메모리가 해제되지 않고 남게 됩니다.
💡 쉬운 설명
시스템이 정보를 처리할 때 똑같은 명령이 두 번 들어오면, 첫 번째로 사용한 메모리 공간을 버리지 못하고 잃어버리는 현상이 발생합니다. 이로 인해 시스템의 메모리가 조금씩 낭비되어 성능 저하나 불안정을 초래할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
SUNRPC: reject duplicate CREDS_VALUE options
gssx_dec_option_array() walks the wire-supplied option array and, for
every entry whose name matches CREDS_VALUE, calls
gssx_dec_linux_creds() on the same struct svc_cred. That helper
unconditionally installs a fresh groups_alloc() result into
creds->cr_group_info without releasing whatever pointer was already
there:
for (i = 0; i < count; i++) {
... decode name ...
if (length == sizeof(CREDS_VALUE) &&
memcmp(p, CREDS_VALUE, sizeof(CREDS_VALUE)) == 0) {
err = gssx_dec_linux_creds(xdr, creds);
...
}
}
A reply that carries two CREDS_VALUE entries therefore overwrites
cr_group_info on the second iteration and orphans the group_info
allocated by the first call. The earlier free_creds path only
releases the last cr_group_info via free_svc_cred(), so the first
allocation's refcount stays at one and its kvmalloc-backed storage
is leaked. No in-tree caller of gssp_accept_sec_context_upcall()
expects more than one CREDS_VALUE per reply.
Fix by tracking whether a CREDS_VALUE option has already been
decoded and returning -EINVAL on any subsequent match, so the
free_creds path releases the single group_info that was installed.
📍 영향받는 시스템
Linux kernel (SUNRPC 관련 모듈을 사용하는 시스템)
⚔️ 공격 벡터
조작된 CREDS_VALUE 옵션이 포함된 RPC 응답을 전송하여 메모리 누수 유발
🛡️ 대응 방법
CREDS_VALUE 옵션의 중복 여부를 확인하고 중복 시 오류를 반환하도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 보안 패치 버전인지 확인합니다.