🇰🇷 한글 설명
Linux 커널의 quota 관리 기능에서 dquot_scan_active() 함수와 quota 비활성화 과정 사이에 레이스 컨디션(경쟁 상태)이 발생합니다. 이로 인해 메모리 압박 상황에서 이미 해제된 dquot 객체를 참조하게 되어 시스템 불안정성을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터가 용량 제한(쿼터)을 정리하는 도중에 다른 작업이 동시에 같은 데이터를 건드리면서 발생하는 오류입니다. 이 과정에서 이미 삭제된 데이터를 다시 사용하려고 시도하여 시스템에 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
quota: Fix race of dquot_scan_active() with quota deactivation
dquot_scan_active() can race with quota deactivation in
quota_release_workfn() like:
CPU0 (quota_release_workfn) CPU1 (dquot_scan_active)
============================== ==============================
spin_lock(&dq_list_lock);
list_replace_init(
&releasing_dquots, &rls_head);
/* dquot X on rls_head,
dq_count == 0,
DQ_ACTIVE_B still set */
spin_unlock(&dq_list_lock);
synchronize_srcu(&dquot_srcu);
spin_lock(&dq_list_lock);
list_for_each_entry(dquot,
&inuse_list, dq_inuse) {
/* finds dquot X */
dquot_active(X) -> true
atomic_inc(&X->dq_count);
}
spin_unlock(&dq_list_lock);
spin_lock(&dq_list_lock);
dquot = list_first_entry(&rls_head);
WARN_ON_ONCE(atomic_read(&dquot->dq_count));
The problem is not only a cosmetic one as under memory pressure the
caller of dquot_scan_active() can end up working on freed dquot.
Fix the problem by making sure the dquot is removed from releasing list
when we acquire a reference to it.
📍 영향받는 시스템
Linux Kernel (quota 기능이 활성화된 버전)
⚔️ 공격 벡터
로컬 시스템에서 특정 타이밍에 쿼터 비활성화와 스캔 작업을 동시에 유도하여 메모리 오류 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 dquot 참조 방식 수정
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.