🇰🇷 한글 설명
Linux 커널의 netfilter x_tables에서, 새 network namespace를 생성할 때 xt_register_table이 실패하면 translate_table에서 할당한 percpu 카운터 블록이 해제되지 않아 메모리 누수가 발생합니다. 이 경로는 ENOMEM 상황에서만 발생하므로 발생 확률은 낮습니다.
💡 쉬운 설명
방화벽 규칙을 만드는 과정에서 메모리 조각이 해제되지 않고 남는 문제입니다. 드물게 발생하며, 누적되면 시스템 메모리가 조금씩 줄어들 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: x_tables: fix percpu counter block leak on error path when creating new netns
Here is the stack where we allocate percpu counter block:
+-< __alloc_percpu
+-< xt_percpu_counter_alloc
+-< find_check_entry # {arp,ip,ip6}_tables.c
+-< translate_table
And it can be leaked on this code path:
+-> ip6t_register_table
+-> translate_table # allocates percpu counter block
+-> xt_register_table # fails
there is no freeing of the counter block on xt_register_table fail.
Note: xt_percpu_counter_free should be called to free it like we do in
do_replace through cleanup_entry helper (or in __ip6t_unregister_table).
Probability of hitting this error path is low AFAICS (xt_register_table
can only return ENOMEM here, as it is not replacing anything, as we are
creating new netns, and it is hard to imagine that all previous
allocations succeeded and after that one in xt_register_table failed).
But it's worth fixing even the rare leak.
📍 영향받는 시스템
Linux 커널 netfilter x_tables(ip_tables, ip6_tables, arp_tables)를 사용하는 수정 전 커널 버전
⚔️ 공격 벡터
외부 공격자가 직접 악용하기 어려우며, 메모리 부족 상황에서 자연스럽게 발생하는 누수로 서비스 안정성에 영향을 줄 수 있습니다.
🛡️ 대응 방법
배포판 보안 업데이트로 패치된 Linux 커널을 설치하고 재부팅하세요.
🔧 검증 코드
출력된 커널 버전을 배포판의 보안 권고문과 대조하여 해당 수정이 포함된 패치 버전인지 확인하세요.