🇰🇷 한글 설명
Linux 커널의 mm/shrinker 구성 요소에서 debugfs의 'count' 파일을 읽을 때 RCU 읽기 측 임계 구역 내에서 수면(sleep)이 발생할 수 있는 취약점입니다. zswap 콜백이 memcg 통계를 플러시하는 과정에서 수면이 발생할 수 있는데, 이는 RCU 잠금 상태에서는 허용되지 않아 커널 버그를 유발합니다.
💡 쉬운 설명
시스템 정보를 확인하는 특정 파일을 읽을 때, 컴퓨터의 핵심 운영체제(커널)가 잠시 멈추거나 오류를 일으킬 수 있는 문제입니다. 이는 잘못된 방식으로 데이터를 처리하는 과정에서 발생하는 내부적인 충돌 때문입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/shrinker: do not hold RCU lock in shrinker_debugfs_count_show()
Reading the debugfs "count" file of a memcg-aware shrinker can sleep
inside an RCU read-side critical section:
BUG: sleeping function called from invalid context at kernel/cgroup/rstat.c:421
RCU nest depth: 1, expected: 0
css_rstat_flush
mem_cgroup_flush_stats
zswap_shrinker_count
shrinker_debugfs_count_show
shrinker_debugfs_count_show() invokes the ->count_objects() callback under
rcu_read_lock(). The zswap callback flushes memcg stats via
css_rstat_flush(), which may sleep, so it must not run under RCU.
The RCU lock is not needed here. mem_cgroup_iter() takes RCU internally
and returns a memcg holding a css reference (dropped on the next iteration
or by mem_cgroup_iter_break()), so the memcg stays alive without it. The
shrinker is kept alive by the open debugfs file: shrinker_free() removes
the debugfs entries via debugfs_remove_recursive(), which waits for
in-flight readers to drain, before call_rcu(..., shrinker_free_rcu_cb).
The sibling "scan" handler already invokes the sleeping ->scan_objects()
callback with no RCU section.
Drop the rcu_read_lock()/rcu_read_unlock().
📍 영향받는 시스템
Linux kernel (mm/shrinker 관련 모듈을 사용하는 시스템)
⚔️ 공격 벡터
로컬 사용자가 debugfs의 'count' 파일을 읽는 행위를 통해 유도 가능
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인