🇰🇷 한글 설명
Linux 커널의 net/smc 구성 요소에서 smc_llc_flow_stop() 함수가 memset을 수행하기 전에 대기 중인 qentry를 해제하지 않아 발생하는 메모리 누수 취약점입니다. 특정 상황에서 중복된 메시지가 유입되면 할당된 kmalloc 객체의 포인터가 덮어씌워져 메모리가 해제되지 않고 유실될 수 있습니다.
💡 쉬운 설명
컴퓨터 메모리를 사용한 뒤 제대로 돌려주지 않고 잊어버리는 실수가 발생하는 보안 약점입니다. 이 문제가 반복되면 시스템의 메모리가 조금씩 줄어들어 결국 성능 저하나 오류를 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/smc: free pending qentry in smc_llc_flow_stop() before memset
smc_llc_flow_stop() resets a flow struct with a blind memset:
spin_lock_bh(&lgr->llc_flow_lock);
memset(flow, 0, sizeof(*flow));
flow->type = SMC_LLC_FLOW_NONE;
spin_unlock_bh(&lgr->llc_flow_lock);
If flow->qentry is non-NULL at this point the pointer is overwritten without the
allocation being freed, leaking one kmalloc object.
A late-arriving duplicate CONFIRM_LINK or ADD_LINK_CONT message can set
flow->qentry after the legitimate message has been consumed by the waiter via
smc_llc_flow_qentry_clr() (which NULLs the pointer but leaves flow->type
non-zero) but before the flow completes and smc_llc_flow_stop() runs. In that
window the duplicate is stashed into flow->qentry, and then lost when
smc_llc_flow_stop() zeros the struct.
Call smc_llc_flow_qentry_del() inside the lock before the memset.
smc_llc_flow_qentry_del() already checks flow->qentry before freeing, so the
normal case where no entry is pending is a no-op.
📍 영향받는 시스템
Linux kernel (net/smc 모듈을 사용하는 버전)
⚔️ 공격 벡터
네트워크를 통해 조작된 중복 CONFIRM_LINK 또는 ADD_LINK_CONT 메시지를 전송하여 메모리 누수 유도
🛡️ 대응 방법
smc_llc_flow_stop() 함수 내 memset 호출 전 smc_llc_flow_qentry_del()를 호출하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인합니다.