🇰🇷 한글 설명
리눅스 커널 netfilter nf_tables에서, 판정 맵(verdict map)과 타임아웃이 활성화된 셋(set)에 대해 준비 단계와 커밋/중단 단계의 처리가 일관되지 않아 만료된 요소가 순회에서 건너뛰어지는 문제가 해결되었습니다. 이로 인해 체인 사용 카운트가 잘못 유지되어 WARN 경고와 nft_chain 구조체 메모리 누수가 발생할 수 있었습니다. 수정으로 pipapo_get()이 만료된 요소도 처리하도록 변경되었습니다.
💡 쉬운 설명
방화벽 규칙 목록에서 만료된 항목을 잘못 무시하면서 내부 참조 정리가 어긋나는 버그입니다. 그 결과 커널이 경고를 띄우고 일부 메모리가 새어 나갈 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_tables: don't skip expired elements during walk
There is an asymmetry between commit/abort and preparation phase if the
following conditions are met:
1. set is a verdict map ("1.2.3.4 : jump foo")
2. timeouts are enabled
In this case, following sequence is problematic:
1. element E in set S refers to chain C
2. userspace requests removal of set S
3. kernel does a set walk to decrement chain->use count for all elements
from preparation phase
4. kernel does another set walk to remove elements from the commit phase
(or another walk to do a chain->use increment for all elements from
abort phase)
If E has already expired in 1), it will be ignored during list walk, so its use count
won't have been changed.
Then, when set is culled, ->destroy callback will zap the element via
nf_tables_set_elem_destroy(), but this function is only safe for
elements that have been deactivated earlier from the preparation phase:
lack of earlier deactivate removes the element but leaks the chain use
count, which results in a WARN splat when the chain gets removed later,
plus a leak of the nft_chain structure.
Update pipapo_get() not to skip expired elements, otherwise flush
command reports bogus ENOENT errors.
📍 영향받는 시스템
nf_tables 기반 netfilter를 사용하는 수정 이전 Linux 커널 버전(패치된 안정 브랜치 기준 업데이트 전 배포판 커널)
⚔️ 공격 벡터
로컬에서 nftables 규칙 셋을 조작할 수 있는 권한(CAP_NET_ADMIN 등)을 가진 사용자가 만료 요소를 포함한 셋을 삭제해 커널 경고와 메모리 누수를 유발할 수 있습니다.
🛡️ 대응 방법
배포판 벤더가 제공하는 최신 커널 보안 업데이트를 설치하고 재부팅합니다.
🔧 검증 코드
출력된 커널 버전을 배포판의 보안 권고문에서 CVE-2023-52924 패치가 포함된 버전과 비교하여, 같거나 이후 버전이면 수정된 것입니다.