# CVE-2022-50675: arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored

> A Linux kernel bug in ARM64 MTE handling causes KASAN access faults and potential crashes when tags are incorrectly set on untagged pages.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Dec 2025
- **Updated:** 11 May 2026
- **Also known as:** DEBIAN-CVE-2022-50675, GHSA-cvq8-ghfq-j2cg, UBUNTU-CVE-2022-50675

## What is CVE-2022-50675?

CVE-2022-50675 is a memory corruption vulnerability in Linux, published on 9 Dec 2025. 

### Official description

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()).

## Which versions are affected by CVE-2022-50675?


## How do I fix CVE-2022-50675?

Apply the vendor's patch.

## Is CVE-2022-50675 being exploited?

There is no known exploitation of CVE-2022-50675 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-50675 and fix it if it is affected.

What it is: CVE-2022-50675 is a memory corruption vulnerability in Linux, published on 9 Dec 2025. 
Exploitation: There is no known exploitation of CVE-2022-50675 in the wild and no public exploit code.

Affected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-50675/ (Markdown: https://insights.sbomify.com/CVE-2022-50675/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-50675
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-50675
- OSV: https://osv.dev/vulnerability/CVE-2022-50675

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-50675/
Summaries are generated and may contain mistakes; the official description above is the record.
