🇰🇷 한글 설명
Linux 커널 DAMON 서브시스템의 damon_sysfs_repeat_call_fn() 함수가 contexts->nr을 확인하지 않고 함수를 호출합니다. nr_contexts를 0으로 설정하면 contexts_arr[0]에 NULL 포인터 역참조가 발생하여 커널 패닉이 유발됩니다.
💡 쉬운 설명
Linux 시스템 모니터링 기능에서 컨텍스트 개수를 0으로 변경하면 비어있는 메모리에 접근하려고 시도합니다. 이로 인해 커널이 충돌할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/damon/sysfs: check contexts->nr in repeat_call_fn
damon_sysfs_repeat_call_fn() calls damon_sysfs_upd_tuned_intervals(),
damon_sysfs_upd_schemes_stats(), and
damon_sysfs_upd_schemes_effective_quotas() without checking contexts->nr.
If nr_contexts is set to 0 via sysfs while DAMON is running, these
functions dereference contexts_arr[0] and cause a NULL pointer
dereference. Add the missing check.
For example, the issue can be reproduced using DAMON sysfs interface and
DAMON user-space tool (damo) [1] like below.
$ sudo damo start --refresh_interval 1s
$ echo 0 | sudo tee \
/sys/kernel/mm/damon/admin/kdamonds/0/contexts/nr_contexts
📍 영향받는 시스템
Linux kernel with DAMON subsystem enabled (CVE-2026-31457 패치 이전의 모든 커널 버전)
⚔️ 공격 벡터
Local unprivileged user can write to /sys/kernel/mm/damon/admin/kdamonds/0/contexts/nr_contexts sysfs interface
🛡️ 대응 방법
Linux kernel 업데이트 또는 CVE-2026-31457 패치 적용 필요
🔧 검증 코드
첫 번째 결과는 DAMON이 활성화되어 있음을 의미하며, 커널 버전 확인으로 패치 적용 여부를 확인해야 함; 두 번째 결과는 DAMON이 비활성화되었거나 접근 불가를 의미
test -w /sys/kernel/mm/damon/admin/kdamonds/0/contexts/nr_contexts 2>/dev/null && echo 'Potentially vulnerable' || echo 'DAMON sysfs not accessible'