🇰🇷 한글 설명
Linux 커널의 zram 구성 요소에서 writeback_store() 함수가 dev_lock을 획득하기 전에 테이블 스캔 범위를 계산하여 발생하는 경계 외 접근(Out-of-bounds access) 취약점입니다. 장치가 재설정되어 디스크 크기가 줄어들 경우, 이전의 큰 범위를 기준으로 새로운 테이블을 스캔하게 되어 메모리 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 가상 메모리(zram)를 관리할 때, 크기를 조절하는 과정에서 계산 오류가 발생하여 허용되지 않은 메모리 영역에 접근할 수 있는 문제입니다. 이로 인해 시스템이 불안정해지거나 예기치 않은 동작이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
zram: fix out-of-bounds access in writeback_store()
Patch series "zram: fix stale scan bounds after reinitialization".
Both writeback_store() and read_block_state() derive their table scan
bounds from zram->disksize before acquiring dev_lock. If the device is
reset and reinitialized with a smaller disksize between that read and lock
acquisition, the bound can describe the old table while the scan operates
on the new one. This can lead to out-of-bounds slot accesses.
Move both bound calculations under dev_lock so each bound remains
consistent with the table throughout its scan. Keep the fixes separate
because the affected interfaces originate from different commits and can
be backported independently.
This patch (of 2):
writeback_store() calculates the table scan bounds before taking dev_lock.
A reset followed by reconfiguration with a smaller disksize can therefore
replace zram->table while writeback_store() is waiting for the lock. Once
it acquires the lock, it sees an initialized device but scans the new
table using the old upper bound, resulting in an out-of-bounds access.
Calculate the number of pages while holding dev_lock so the scan bound
matches the table protected by the lock.
📍 영향받는 시스템
zram 기능을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
로컬 공격자가 zram 장치를 재설정하고 크기를 변경하는 과정을 통해 메모리 경계 외 접근 유도
🛡️ 대응 방법
zram 관련 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인