🇰🇷 한글 설명
Linux 커널 arm64 아키텍처의 MTE(Memory Tagging Extension) 처리에서, 페이지 태그가 실제로 지워지거나 복원되지 않았음에도 PG_mte_tagged 플래그가 설정되는 문제가 수정되었습니다. 이로 인해 KASAN 태그가 있는 페이지가 복사되면서 잘못된 메모리 접근 오류가 발생할 수 있었습니다. 수정은 플래그 설정 위치를 mte_sync_tags()에서 mte_sync_page_tags()와 mte_restore_tags()로 옮기는 방식입니다.
💡 쉬운 설명
메모리 보호 기능이 필요하지 않은 페이지에도 잘못 표시가 붙어, 페이지 복사 시 오류가 생길 수 있었습니다. 이 문제는 표시를 실제 작업이 일어나는 시점으로 옮겨 해결되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored
Prior to commit 69e3b846d8a7 ("arm64: mte: Sync tags for pages where PTE
is untagged"), mte_sync_tags() was only called for pte_tagged() entries
(those mapped with PROT_MTE). Therefore mte_sync_tags() could safely use
test_and_set_bit(PG_mte_tagged, &page->flags) without inadvertently
setting PG_mte_tagged on an untagged page.
The above commit was required as guests may enable MTE without any
control at the stage 2 mapping, nor a PROT_MTE mapping in the VMM.
However, the side-effect was that any page with a PTE that looked like
swap (or migration) was getting PG_mte_tagged set automatically. A
subsequent page copy (e.g. migration) copied the tags to the destination
page even if the tags were owned by KASAN.
This issue was masked by the page_kasan_tag_reset() call introduced in
commit e5b8d9218951 ("arm64: mte: reset the page tag in page->flags").
When this commit was reverted (20794545c146), KASAN started reporting
access faults because the overriding tags in a page did not match the
original page->flags (with CONFIG_KASAN_HW_TAGS=y):
BUG: KASAN: invalid-access in copy_page+0x10/0xd0 arch/arm64/lib/copy_page.S:26
Read at addr f5ff000017f2e000 by task syz-executor.1/2218
Pointer tag: [f5], memory tag: [f2]
Move the PG_mte_tagged bit setting from mte_sync_tags() to the actual
place where tags are cleared (mte_sync_page_tags()) or restored
(mte_restore_tags()).
📍 영향받는 시스템
Linux 커널 arm64 아키텍처의 MTE 기능을 사용하는 수정 전 버전 (KASAN HW Tags 활성화 환경 중심)
⚔️ 공격 벡터
공개된 정보상 원격 악용 경로는 명확하지 않으며, 주로 KASAN 잘못된 접근 오류와 메모리 복사 시 안정성 문제로 보고됨
🛡️ 대응 방법
배포판 제공 최신 커널 업데이트 적용 또는 커널 소스에 해당 커밋 반영 후 재부팅
🔧 검증 코드
출력된 커널 버전이 해당 CVE를 수정한 배포판 패치 버전 이상인지 배포판 보안 공지와 대조하여 확인하며, 아키텍처가 aarch64인지도 uname -m으로 함께 확인