🇰🇷 한글 설명
Linux 커널의 DAMON LRU_SORT 기능에서 active_mem_bp 파라미터 값을 10000보다 크게 설정할 경우, 내부 계산 과정에서 0으로 나누기 오류(Division by Zero)가 발생할 수 있습니다. 이로 인해 시스템 커널 패닉(Oops)이 발생하여 시스템이 중단될 수 있는 취약점입니다.
💡 쉬운 설명
특정 설정값을 너무 높게 입력하면 컴퓨터의 두뇌 역할을 하는 커널이 계산을 하다가 0으로 나누는 실수를 하여 시스템이 멈춰버릴 수 있습니다. 공격자가 이 값을 조작할 수 있다면 시스템을 강제로 다운시킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/damon/lru_sort: error out for >10000 active_mem_bp
damos_quota_score() can trigger division by zero if the target value is
zero. DAMON_LRU_SORT lets users set the target value for the hot memory
scheme via active_mem_bp parameter. It avoids setting it as the target
value if the parameter value is zero. However, it also sets the cold
memory scheme with a target value that is calculated as '10000 -
active_mem_bp + 2'. Hence, if a user sets active_mem_bp 10002, the cold
memory scheme's quota goal target value can be zero. As a result,
division by zero can be triggered. Fix by returning an error when the
user tries to start DAMON with >10000 active_mem_bp parameter value.
It makes no sense to set active_mem_bp with 10002. It also requires
module parameters write permission to reproduce the issue. That said, the
consequence is quite bad.
One reliable way to reproduce the issue is like below:
# cd /sys/module/damon_lru_sort/parameters
# echo 1000 > wmarks_high
# echo 995 > wmarks_mid
# echo 0 > wmarks_low
# echo 10002 > active_mem_bp
# echo Y > enabled
# dmesg -w
[...]
[ 597.421247] Oops: divide error: 0000 [#1] SMP NOPTI
[ 597.428848] RIP: 0010:damos_quota_score+0x6f/0x480
This issue was discovered [1] by Sashiko.
📍 영향받는 시스템
DAMON(Data Access Monitor)의 LRU_SORT 기능을 사용하는 Linux 커널
⚔️ 공격 벡터
모듈 파라미터 쓰기 권한을 가진 사용자가 sysfs를 통해 active_mem_bp 값을 10000 초과로 설정
🛡️ 대응 방법
active_mem_bp 파라미터가 10000을 초과할 경우 에러를 반환하도록 커널을 업데이트하거나 해당 모듈 설정을 제한함
🔧 검증 코드
출력된 커널 버전이 DAMON LRU_SORT 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.