🇰🇷 한글 설명
Linux 커널의 net/smc 구성 요소에서 smc_switch_conns() 함수 호출 시 소켓 참조 횟수(refcount)가 누수되는 취약점이 발견되었습니다. 특정 오류 상황에서 sock_put()이 호출되지 않아 소켓이 메모리에서 해제되지 않으며, 이로 인해 네트워크 네임스페이스를 제거할 수 없는 문제가 발생합니다.
💡 쉬운 설명
네트워크 연결을 전환하는 과정에서 오류가 발생하면, 사용이 끝난 연결 정보가 메모리에서 지워지지 않고 계속 쌓이는 버그입니다. 이 문제가 반복되면 시스템 메모리가 낭비되고 네트워크 설정 변경이 불가능해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/smc: fix socket refcount leak in smc_switch_conns()
smc_switch_conns() takes a reference on the SMC socket before dropping
lgr->conns_lock, so the connection stays alive while the CDC slot is
fetched:
sock_hold(&smc->sk);
read_unlock_bh(&lgr->conns_lock);
/* pre-fetch buffer outside of send_lock, might sleep */
rc = smc_cdc_get_free_slot(conn, to_lnk, &wr_buf, NULL, &pend);
if (rc)
goto err_out;
The err_out label only drops the wr_tx link reference, so this early exit
returns without the matching sock_put(). The second error exit is not
affected, because sock_put() has already run by then.
A leaked sk_refcnt means the smc_sock is never destroyed. Its send and
receive buffers stay allocated, and for a user socket the reference held
on the network namespace is never released, so the netns can no longer be
torn down.
smc_cdc_get_free_slot() fails when the target link goes down or when the
connection has been killed while the switch is in progress. Both are
reachable during the link failover this function implements, so the leak
is triggered by the same hardware events that make smc_switch_conns() run
in the first place.
Restructure so there is a single sock_put() covering both outcomes,
instead of adding a second one to the error path.
📍 영향받는 시스템
Linux Kernel (net/smc 모듈을 사용하는 시스템)
⚔️ 공격 벡터
하드웨어 링크 장애 또는 연결 강제 종료를 유도하여 smc_switch_conns() 내의 오류 경로를 실행
🛡️ 대응 방법
smc_switch_conns() 함수의 참조 횟수 관리 로직이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 확인