🇰🇷 한글 설명
Linux 커널의 DAMON(Data Access Monitor) 구성 요소에서 node_mem_quota_goal의 노드 ID(nid)에 대한 유효성 검증이 누락된 취약점입니다. 권한이 있는 사용자가 DAMON_SYSFS를 통해 임의의 값을 설정할 경우, 커널 내에서 경계 외 메모리 접근(Out-of-bounds access)이 발생하여 시스템 충돌이나 NULL 포인터 역참조를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 메모리를 관리하는 기능에서 잘못된 번호를 입력받아 시스템이 엉뚱한 메모리 주소를 읽으려다 멈춰버리는 문제입니다. 관리자 권한을 가진 사용자가 이 기능을 잘못 조작하면 시스템을 강제로 다운시킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/damon/core: validate damos_quota_goal->nid for node_mem_{used,free}_bp
Patch series "mm/damon/core: validate damos_quota_goal->nid".
node_mem[cg]_{used,free}_bp DAMOS quota goals receive the node id. The
node id is used for si_meminfo_node() and NODE_DATA() without proper
validation. As a result, privileged users can trigger an out of bounds
memory access using DAMON_SYSFS. Fix the issues.
The issue was originally reported [1] with a fix by another author. The
original author announced [2] that they will stop working including the
fix that was still in the review stage. Hence I'm restarting this.
This patch (of 2):
Users can set damos_quota_goal->nid with arbitrary value for
node_mem_{used,free}_bp. But DAMON core is using those for
si_meminfo_node() without the validation of the value. This can result in
out of bounds memory access. The issue can actually triggered using DAMON
user-space tool (damo), like below.
$ sudo ./damo start --damos_action stat \
--damos_quota_goal node_mem_used_bp 50% -1 \
--damos_quota_interval 1s
$ sudo dmesg
[...]
[ 65.565986] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000098
Fix this issue by adding the validation of the given node. If an invalid
node id is given, it returns 0% for used memory ratio, and 100% for free
memory ratio.
📍 영향받는 시스템
DAMON 기능이 활성화된 Linux 커널 버전
⚔️ 공격 벡터
DAMON 사용자 공간 도구(damo) 또는 DAMON_SYSFS를 통한 임의의 node id 설정
🛡️ 대응 방법
해당 취약점이 수정된 최신 Linux 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이상인지 확인합니다.