🔍 CVE-2025-21860

3.3
CVSS Score
LOW
2025-03-12
2026-06-17 08:44
✅ 완료

🇰🇷 한글 설명

Linux 커널의 zswap 구성 요소에서 zswap_store_page() 작업이 실패할 때 메모리 카운팅 불일치가 발생하는 취약점입니다. 이로 인해 메모리 제어(memcontrol) 및 페이지 카운터에서 언더플로우 경고가 발생할 수 있습니다.

💡 쉬운 설명

컴퓨터의 메모리를 압축해서 저장하는 기능(zswap)에서 계산 오류가 발생하여, 실제 사용량과 기록된 사용량이 맞지 않게 되는 문제입니다. 이 오류가 누적되면 시스템 경고가 발생하거나 메모리 관리 기능에 혼란을 줄 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: mm/zswap: fix inconsistency when zswap_store_page() fails Commit b7c0ccdfbafd ("mm: zswap: support large folios in zswap_store()") skips charging any zswap entries when it failed to zswap the entire folio. However, when some base pages are zswapped but it failed to zswap the entire folio, the zswap operation is rolled back. When freeing zswap entries for those pages, zswap_entry_free() uncharges the zswap entries that were not previously charged, causing zswap charging to become inconsistent. This inconsistency triggers two warnings with following steps: # On a machine with 64GiB of RAM and 36GiB of zswap $ stress-ng --bigheap 2 # wait until the OOM-killer kills stress-ng $ sudo reboot The two warnings are: in mm/memcontrol.c:163, function obj_cgroup_release(): WARN_ON_ONCE(nr_bytes & (PAGE_SIZE - 1)); in mm/page_counter.c:60, function page_counter_cancel(): if (WARN_ONCE(new < 0, "page_counter underflow: %ld nr_pages=%lu\n", new, nr_pages)) zswap_stored_pages also becomes inconsistent in the same way. As suggested by Kanchana, increment zswap_stored_pages and charge zswap entries within zswap_store_page() when it succeeds. This way, zswap_entry_free() will decrement the counter and uncharge the entries when it failed to zswap the entire folio. While this could potentially be optimized by batching objcg charging and incrementing the counter, let's focus on fixing the bug this time and leave the optimization for later after some evaluation. After resolving the inconsistency, the warnings disappear. [[email protected]: refactor zswap_store_page()]

📍 영향받는 시스템

Linux Kernel (zswap 기능을 사용하는 버전)

⚔️ 공격 벡터

로컬 사용자가 메모리 압박 상황(stress-ng 등)을 유도하여 발생 가능

🛡️ 대응 방법

zswap 관련 커널 패치(commit b7c0ccdfbafd 및 관련 수정사항)를 적용하여 최신 커널로 업데이트

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L

💻 영향받는 소프트웨어

Sudo