🇰🇷 한글 설명
리눅스 커널의 zram 구성 요소에서 동일한 인덱스에 대해 병렬로 쓰기 작업이 발생할 때 레이스 컨디션(경쟁 상태)이 발생하는 취약점입니다. 이로 인해 zsmalloc 핸들이 적절히 해제되지 않고 메모리 누수가 발생할 수 있습니다.
💡 쉬운 설명
여러 작업이 동시에 같은 메모리 공간을 수정하려고 할 때 순서가 꼬여서 메모리가 제대로 정리되지 않는 문제입니다. 이 문제가 지속되면 시스템의 메모리가 조금씩 낭비되어 성능 저하나 불안정을 초래할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
zram: fix slot write race condition
Parallel concurrent writes to the same zram index result in leaked
zsmalloc handles. Schematically we can have something like this:
CPU0 CPU1
zram_slot_lock()
zs_free(handle)
zram_slot_lock()
zram_slot_lock()
zs_free(handle)
zram_slot_lock()
compress compress
handle = zs_malloc() handle = zs_malloc()
zram_slot_lock
zram_set_handle(handle)
zram_slot_lock
zram_slot_lock
zram_set_handle(handle)
zram_slot_lock
Either CPU0 or CPU1 zsmalloc handle will leak because zs_free() is done
too early. In fact, we need to reset zram entry right before we set its
new handle, all under the same slot lock scope.
📍 영향받는 시스템
zram 모듈을 사용하는 Linux Kernel (패치 적용 전 버전)
⚔️ 공격 벡터
로컬 사용자가 병렬 쓰기 작업을 유도하여 메모리 누수를 발생시킴
🛡️ 대응 방법
zram 슬롯 잠금 범위 내에서 핸들을 재설정하도록 수정된 최신 리눅스 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 최신 보안 패치 버전인지 확인