]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Preserve the PG_arch_2 flag in __split_huge_page_tail()
authorCatalin Marinas <catalin.marinas@arm.com>
Thu, 2 Jul 2020 09:19:30 +0000 (10:19 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 4 Sep 2020 11:46:06 +0000 (12:46 +0100)
commit7549d07b1e3749927bdcbef5dc4ccfe6e0d63bb2
tree2a93b64e0cb4c03c82bbb896215ff51151571f39
parent4aaa6e8558f303aa037f94e1748bb90e2c0e988d
mm: Preserve the PG_arch_2 flag in __split_huge_page_tail()

When a huge page is split into normal pages, part of the head page flags
are transferred to the tail pages. However, the PG_arch_* flags are not
part of the preserved set.

PG_arch_2 is used by the arm64 MTE support to mark pages that have valid
tags. The absence of such flag would cause the arm64 set_pte_at() to
clear the tags in order to avoid stale tags exposed to user or the
swapping out hooks to ignore the tags. Not preserving PG_arch_2 on huge
page splitting leads to tag corruption in the tail pages.

Preserve the newly added PG_arch_2 flag in __split_huge_page_tail().

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c