{"id":"CVE-2022-50675","aliases":["CVE-2022-50675"],"related":[],"kind":"vulnerability","state":"published","title":"arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\narm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored\n\nPrior to commit 69e3b846d8a7 (\"arm64: mte: Sync tags for pages where PTE\nis untagged\"), mte_sync_tags() was only called for pte_tagged() entries\n(those mapped with PROT_MTE). Therefore mte_sync_tags() could safely use\ntest_and_set_bit(PG_mte_tagged, &page->flags) without inadvertently\nsetting PG_mte_tagged on an untagged page.\n\nThe above commit was required as guests may enable MTE without any\ncontrol at the stage 2 mapping, nor a PROT_MTE mapping in the VMM.\nHowever, the side-effect was that any page with a PTE that looked like\nswap (or migration) was getting PG_mte_tagged set automatically. A\nsubsequent page copy (e.g. migration) copied the tags to the destination\npage even if the tags were owned by KASAN.\n\nThis issue was masked by the page_kasan_tag_reset() call introduced in\ncommit e5b8d9218951 (\"arm64: mte: reset the page tag in page->flags\").\nWhen this commit was reverted (20794545c146), KASAN started reporting\naccess faults because the overriding tags in a page did not match the\noriginal page->flags (with CONFIG_KASAN_HW_TAGS=y):\n\n  BUG: KASAN: invalid-access in copy_page+0x10/0xd0 arch/arm64/lib/copy_page.S:26\n  Read at addr f5ff000017f2e000 by task syz-executor.1/2218\n  Pointer tag: [f5], memory tag: [f2]\n\nMove the PG_mte_tagged bit setting from mte_sync_tags() to the actual\nplace where tags are cleared (mte_sync_page_tags()) or restored\n(mte_restore_tags()).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\narm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored\n\nPrior to commit 69e3b846d8a7 (\"arm64: mte: Sync tags for pages where PTE\nis untagged\"), mte_sync_tags() was only called for pte_tagged() entries\n(those mapped with PROT_MTE). Therefore mte_sync_tags() could safely use\ntest_and_set_bit(PG_mte_tagged, &page->flags) without inadvertently\nsetting PG_mte_tagged on an untagged page.\n\nThe above commit was required as guests may enable MTE without any\ncontrol at the stage 2 mapping, nor a PROT_MTE mapping in the VMM.\nHowever, the side-effect was that any page with a PTE that looked like\nswap (or migration) was getting PG_mte_tagged set automatically. A\nsubsequent page copy (e.g. migration) copied the tags to the destination\npage even if the tags were owned by KASAN.\n\nThis issue was masked by the page_kasan_tag_reset() call introduced in\ncommit e5b8d9218951 (\"arm64: mte: reset the page tag in page->flags\").\nWhen this commit was reverted (20794545c146), KASAN started reporting\naccess faults because the overriding tags in a page did not match the\noriginal page->flags (with CONFIG_KASAN_HW_TAGS=y):\n\n  BUG: KASAN: invalid-access in copy_page+0x10/0xd0 arch/arm64/lib/copy_page.S:26\n  Read at addr f5ff000017f2e000 by task syz-executor.1/2218\n  Pointer tag: [f5], memory tag: [f2]\n\nMove the PG_mte_tagged bit setting from mte_sync_tags() to the actual\nplace where tags are cleared (mte_sync_page_tags()) or restored\n(mte_restore_tags()).","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\narm64: mte: Evitar establecer PG_mte_tagged si no se borran o restauran etiquetas\n\nAntes del commit 69e3b846d8a7 (’arm64: mte: Sincronizar etiquetas para páginas donde el PTE no está etiquetado’), mte_sync_tags() solo se llamaba para entradas pte_tagged() (aquellas mapeadas con PROT_MTE). Por lo tanto, mte_sync_tags() podía usar de forma segura test_and_set_bit(PG_mte_tagged, &page  ->  flags) sin establecer inadvertidamente PG_mte_tagged en una página sin etiquetar.\n\nEl commit anterior fue necesario ya que los invitados pueden habilitar MTE sin ningún control en el mapeo de etapa 2, ni un mapeo PROT_MTE en el VMM. Sin embargo, el efecto secundario fue que cualquier página con un PTE que parecía de intercambio (o migración) estaba obteniendo PG_mte_tagged establecido automáticamente. Una copia de página posterior (por ejemplo, migración) copiaba las etiquetas a la página de destino incluso si las etiquetas eran propiedad de KASAN.\n\nEste problema fue enmascarado por la llamada a page_kasan_tag_reset() introducida en el commit e5b8d9218951 (’arm64: mte: restablecer la etiqueta de página en page  ->  flags’). Cuando este commit fue revertido (20794545c146), KASAN comenzó a reportar fallos de acceso porque las etiquetas sobrescribientes en una página no coincidían con las page  ->  flags originales (con CONFIG_KASAN_HW_TAGS=y):\n\nBUG: KASAN: acceso-inválido en copy_page+0x10/0xd0 arch/arm64/lib/copy_page.S:26\nLectura en la dirección f5ff000017f2e000 por la tarea syz-executor.1/2218\nEtiqueta del puntero: [f5], etiqueta de memoria: [f2]\n\nMover la configuración del bit PG_mte_tagged de mte_sync_tags() al lugar real donde las etiquetas se borran (mte_sync_page_tags()) o se restauran (mte_restore_tags()).","source":"nvd"}],"published":"2025-12-09T01:29:27.926Z","modified":"2026-11-10T12:10:00.177Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"69e3b846d8a753f9f279f29531ca56b0f7563ad0","fixed":"918002bdbe4328c8c0164a22e8ebf2384b80dc23","status":"affected"},{"type":"git","introduced":"69e3b846d8a753f9f279f29531ca56b0f7563ad0","fixed":"749e9fc18b1e1a3f93a9512e91bd7f93002d2821","status":"affected"},{"type":"git","introduced":"69e3b846d8a753f9f279f29531ca56b0f7563ad0","fixed":"a8e5e5146ad08d794c58252bab00b261045ef16d","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.14","status":"unaffected"},{"type":"semver","introduced":"5.15.82","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.0.3","lastAffected":"6.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/918002bdbe4328c8c0164a22e8ebf2384b80dc23","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/749e9fc18b1e1a3f93a9512e91bd7f93002d2821","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a8e5e5146ad08d794c58252bab00b261045ef16d","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50675","url":"https://www.cve.org/CVERecord?id=CVE-2022-50675","licence":"CVE Terms of Use","modified":"2026-05-11T19:23:36.334Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50675","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50675","licence":"Public domain","modified":"2026-11-10T12:10:00.177Z"}],"updatedAt":"2026-11-25T22:58:21.316Z","epss":{"score":0.00259,"percentile":0.18781,"date":"2026-12-01T12:00:22.000Z"}}