🇰🇷 한글 설명
Linux 커널의 xfrm(IPsec) 정책 관리에서 RCU 기반 해시 테이블을 해제할 때 동시 RCU readers가 읽기 작업을 완료할 때까지 기다리지 않아 메모리 손상이 발생할 수 있는 취약점입니다. netns 종료 시 RCU grace period 없이 policy_bydst 테이블을 메모리에서 해제하면 접근 중인 readers가 해제된 메모리에 접근하게 됩니다.
💡 쉬운 설명
Linux 시스템이 종료될 때 보안 정책 데이터를 정리하는 과정에서, 아직 이 데이터를 사용 중인 프로세스가 있는지 확인하지 않고 바로 삭제합니다. 결과적으로 메모리가 손상되어 시스템이 불안정해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xfrm: Wait for RCU readers during policy netns exit
xfrm_policy_fini() frees the policy_bydst hash tables after flushing the
policy work items and deleting all policies, but it does not wait for
concurrent RCU readers to leave their read-side critical sections first.
The policy_bydst tables are published via rcu_assign_pointer() and are
looked up through rcu_dereference_check(), so netns teardown must also
wait for an RCU grace period before freeing the table memory.
Fix this by adding synchronize_rcu() before freeing the policy hash tables.
📍 영향받는 시스템
Linux kernel 전체 버전 (xfrm/IPsec 정책 관리 기능 사용 시스템)
⚔️ 공격 벡터
네트워크 네임스페이스 종료 시 race condition을 유발하여 메모리 손상 및 커널 패닉 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치 버전으로 업그레이드
🔧 검증 코드
CONFIG_XFRM 또는 CONFIG_NET_NS가 y로 설정되어 있으면 해당 시스템이 영향을 받을 가능성이 있으므로 커널 업데이트 필요
grep -i 'CONFIG_XFRM\|CONFIG_NET_NS' /boot/config-$(uname -r) | head -2