Catalin Marinas 1d0cb4c886 arm64: mte: Ensure the cleared tags are visible before setting the PTE
As an optimisation, only pages mapped with PROT_MTE in user space have
the MTE tags zeroed. This is done lazily at the set_pte_at() time via
mte_sync_tags(). However, this function is missing a barrier and another
CPU may see the PTE updated before the zeroed tags are visible. Add an
smp_wmb() barrier if the mapping is Normal Tagged.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 34bfeea4a9e9 ("arm64: mte: Clear the tags when a page is mapped in user-space with PROT_MTE")
Cc: <stable@vger.kernel.org> # 5.10.x
Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Steven Price <steven.price@arm.com>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
Link: https://lore.kernel.org/r/20220517093532.127095-1-catalin.marinas@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2022-05-17 14:29:51 +01:00
..
2021-10-01 13:31:00 +01:00
2021-08-04 16:54:36 +00:00
2022-03-22 14:39:12 -07:00
2022-04-04 10:32:50 +01:00
2022-03-24 11:58:57 -07:00
2020-09-07 15:00:52 +01:00
2021-03-24 20:19:30 +00:00
2022-04-04 10:32:50 +01:00
2022-01-12 16:26:58 -08:00
2021-09-01 15:04:29 -07:00
2022-03-28 17:29:53 -07:00
2021-04-16 16:10:36 -07:00
2022-04-04 10:32:50 +01:00
2021-12-01 00:06:44 +01:00
2022-03-23 18:03:08 -07:00