🇰🇷 한글 설명
Linux 커널의 netfilter nf_log 구성 요소에서 네트워크 네임스페이스 해제 시 전역 로거 백엔드 해제 순서가 잘못되어 발생하는 레이스 컨디션 취약점입니다. 네트워크 네임스페이스가 정리되는 동안 공격자가 로거를 다시 바인딩할 수 있으며, 이로 인해 해제된 메모리 영역을 참조하는 Use-After-Free 문제가 발생할 수 있습니다.
💡 쉬운 설명
시스템이 네트워크 설정을 정리하는 도중에 공격자가 교묘하게 끼어들어 이미 사라진 메모리 주소를 다시 사용하게 만드는 보안 허점입니다. 이 과정에서 시스템이 잘못된 메모리를 읽으려다 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_log: unregister loggers before per-net teardown
nf_log_syslog and nfnetlink_log unregister their per-network namespace
operations before unregistering their global logger backends. This
leaves a window where a sysctl or netlink writer can rebind the still-
registered logger after the per-net pre-exit callback cleared the old
selection.
The race looks like this:
CPU 0 CPU 1
---- ----
unregister_pernet_subsys()
nf_log_unset(net, logger)
net->nf.nf_loggers[pf] = NULL
lock nf_log_mutex
find logger in loggers[][]
net->nf.nf_loggers[pf] = logger
unlock nf_log_mutex
nf_log_unregister(logger)
lock nf_log_mutex
loggers[pf][type] = NULL
unlock nf_log_mutex
synchronize_rcu()
module exit returns
module core frees backend memory
Later, a sysctl read or packet logging operation can dereference the
stale per-net logger pointer.
Fix this by unregistering the global logger backends before tearing down
per-net state. Once the global registrations are gone, later writers can
no longer rebind the logger. unregister_pernet_subsys() already waits
for an RCU grace period after the pre-exit callback clears the per-net
selection, while nf_log_unregister() continues to cover readers of the
global logger table.
Apply this ordering fix to both nf_log backends that combine per-net
teardown with global logger registration.
📍 영향받는 시스템
Linux Kernel (netfilter/nf_log 관련 모듈 사용 시스템)
⚔️ 공격 벡터
네트워크 네임스페이스 해제 과정 중 sysctl 또는 netlink를 이용한 로거 재바인딩 레이스 컨디션 공격
🛡️ 대응 방법
커널 패치를 적용하여 전역 로거 백엔드를 네트워크 네임스페이스 해제보다 먼저 등록 해제하도록 순서를 수정해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 배포판 보안 공지를 통해 대조합니다.