🔍 CVE-2022-49052

7.1
CVSS Score
HIGH
2025-02-26
2026-08-04 10:17
✅ 완료

🇰🇷 한글 설명

Linux 커널의 zram 스왑 과정에서 CLONE_VM 클로닝을 사용하는 두 프로세스 간에 예기치 않게 0으로 채워진 페이지가 매핑되는 취약점입니다. 이로 인해 사용자 프로세스의 데이터가 손상될 수 있는 메모리 무결성 문제가 발생할 수 있습니다.

💡 쉬운 설명

컴퓨터가 메모리를 효율적으로 쓰려고 데이터를 압축해서 보관하는 과정에서, 원래 데이터 대신 0으로 가득 찬 잘못된 데이터를 읽어오는 오류입니다. 이로 인해 실행 중인 프로그램의 데이터가 깨지거나 오류가 발생할 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: mm: fix unexpected zeroed page mapping with zram swap Two processes under CLONE_VM cloning, user process can be corrupted by seeing zeroed page unexpectedly. CPU A CPU B do_swap_page do_swap_page SWP_SYNCHRONOUS_IO path SWP_SYNCHRONOUS_IO path swap_readpage valid data swap_slot_free_notify delete zram entry swap_readpage zeroed(invalid) data pte_lock map the *zero data* to userspace pte_unlock pte_lock if (!pte_same) goto out_nomap; pte_unlock return and next refault will read zeroed data The swap_slot_free_notify is bogus for CLONE_VM case since it doesn't increase the refcount of swap slot at copy_mm so it couldn't catch up whether it's safe or not to discard data from backing device. In the case, only the lock it could rely on to synchronize swap slot freeing is page table lock. Thus, this patch gets rid of the swap_slot_free_notify function. With this patch, CPU A will see correct data. CPU A CPU B do_swap_page do_swap_page SWP_SYNCHRONOUS_IO path SWP_SYNCHRONOUS_IO path swap_readpage original data pte_lock map the original data swap_free swap_range_free bd_disk->fops->swap_slot_free_notify swap_readpage read zeroed data pte_unlock pte_lock if (!pte_same) goto out_nomap; pte_unlock return on next refault will see mapped data by CPU B The concern of the patch would increase memory consumption since it could keep wasted memory with compressed form in zram as well as uncompressed form in address space. However, most of cases of zram uses no readahead and do_swap_page is followed by swap_free so it will free the compressed form from in zram quickly.

📍 영향받는 시스템

zram 스왑을 사용하는 Linux 커널 (CLONE_VM을 사용하는 멀티스레드 환경)

⚔️ 공격 벡터

로컬 공격자가 특정 메모리 관리 시나리오를 유도하여 프로세스 메모리 내의 데이터를 0으로 덮어쓰는 방식

🛡️ 대응 방법

zram 관련 swap_slot_free_notify 로직이 수정된 최신 Linux 커널 버전으로 업데이트

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 패치된 배포판의 보안 업데이트 버전인지 확인

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:H/A:H

💻 영향받는 소프트웨어

Linux Kernel