🇰🇷 한글 설명
Linux 커널의 stmmac 네트워크 드라이버에서 64비트 통계 카운터 업데이트 시 상호 배제가 보장되지 않아 발생하는 취약점입니다. 32비트 플랫폼에서 특정 상황 발생 시 시퀀스 카운트 업데이트가 누락되어 읽기 프로세스가 영구적으로 차단되는 락업(Lockup) 현상이 발생할 수 있습니다.
💡 쉬운 설명
네트워크 데이터를 처리하는 과정에서 숫자를 기록하는 방식에 오류가 있어, 컴퓨터가 특정 상황에서 멈춰버릴 수 있는 문제입니다. 특히 32비트 환경의 시스템에서 데이터 기록 순서가 꼬이면서 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: stmmac: protect updates of 64-bit statistics counters
As explained by a comment in <linux/u64_stats_sync.h>, write side of struct
u64_stats_sync must ensure mutual exclusion, or one seqcount update could
be lost on 32-bit platforms, thus blocking readers forever. Such lockups
have been observed in real world after stmmac_xmit() on one CPU raced with
stmmac_napi_poll_tx() on another CPU.
To fix the issue without introducing a new lock, split the statics into
three parts:
1. fields updated only under the tx queue lock,
2. fields updated only during NAPI poll,
3. fields updated only from interrupt context,
Updates to fields in the first two groups are already serialized through
other locks. It is sufficient to split the existing struct u64_stats_sync
so that each group has its own.
Note that tx_set_ic_bit is updated from both contexts. Split this counter
so that each context gets its own, and calculate their sum to get the total
value in stmmac_get_ethtool_stats().
For the third group, multiple interrupts may be processed by different CPUs
at the same time, but interrupts on the same CPU will not nest. Move fields
from this group to a newly created per-cpu struct stmmac_pcpu_stats.
📍 영향받는 시스템
Linux kernel (stmmac driver 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 네트워크 트래픽을 유발하여 특정 CPU 간의 레이스 컨디션(Race Condition)을 유도함으로써 시스템 락업 유발 가능
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 stmmac 통계 카운터 구조를 수정해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인