🇰🇷 한글 설명
리눅스 커널 openvswitch 모듈의 netlink 플로우 덤프 과정에서 stats->lock 해제 시 발생하는 BH 재활성화로 인해 소프트 IRQ 백로그를 덤프 스레드가 무제한 처리하면서 소프트 락업이 발생하는 문제입니다. 해당 콜백 전체 구간에 BH를 비활성화하여 문제를 해결합니다.
💡 쉬운 설명
네트워크 플로우 정보를 조회하는 과정에서 한 작업이 CPU를 계속 점유해 시스템이 멈춘 것처럼 보이는 문제입니다. 커널 패치로 작업 중 잠시 네트워크 후처리 작업이 끼어들지 않도록 하여 해결합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
openvswitch: fix soft lockup in the netlink flow dump
A production compute node carrying a few thousand datapath flows hit a
soft lockup inside a single netlink flow dump and panicked.
ovs_flow_cmd_dump() calls ovs_flow_stats_get() for every flow it
emits, and that releases stats->lock with spin_unlock_bh() once per
CPU that has touched the flow. Every release is a local_bh_enable(),
and each one runs the pending softirq backlog in the dumping thread's
own context.
The skb bounds the flows one callback emits, but not the softirq work
it absorbs. On a CPU that carries the box's packet load the backlog
refills as fast as it drains, so the dumping thread becomes that CPU's
softirq engine. It never sleeps and it has no reschedule point, so
under voluntary preemption nothing can take the CPU away from it:
neither the ksoftirqd the kernel woke to take the work over, nor the
stopper thread the softlockup detector dispatches to refresh its
timestamp.
Hold BH off across the whole callback instead, the way
ctnetlink_dump_table() does, so the nested spin_unlock_bh() stop
draining softirqs. The loop already runs under rcu_read_lock() and
cannot sleep. What it gives up is preemption under CONFIG_PREEMPT,
since a BH-off region is not preemptible outside PREEMPT_RT. The
region stays short: the skb caps the flows one callback emits, and
empty buckets cost no skb space but are each visited once per dump, as
the cursor only moves forward. The table grows on insert and shrinks
only on flush, so the walk is bounded by the largest flow count the
datapath has held. The softirq backlog the callback used to absorb has
no bound at all.
📍 영향받는 시스템
Linux 커널 openvswitch 모듈을 사용하는 수정 이전 버전(패치 적용 전 커널 전반, 정확한 버전 범위는 해당 커널 배포판 공지 확인 필요)
⚔️ 공격 벡터
로컬 또는 관리 권한을 가진 사용자가 대량의 datapath 플로우가 있는 환경에서 netlink 플로우 덤프를 반복 유발해 서비스 거부(소프트 락업)를 일으킬 수 있습니다.
🛡️ 대응 방법
배포판 제공 최신 커널 업데이트를 적용하거나 해당 커널 패치가 포함된 버전으로 재부팅합니다.
🔧 검증 코드
커널 버전이 배포판의 수정 버전 이상인지 확인하고, openvswitch 모듈이 로드되어 있다면 해당 커널이 패치를 포함하는지 벤더 공지와 대조합니다.
uname -r && grep -i openvswitch /proc/modules 2>/dev/null