diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2022-05-17 10:35:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-25 09:17:56 +0200 |
commit | 6013ef5f51e0861a904b74a694e621bb451fe7ae (patch) | |
tree | 08588ab7d371cba98b2636a3796d4f129439262c /drivers/crypto | |
parent | a817f78ed69bba10d724587dab84a164dac05900 (diff) | |
download | linux-stable-6013ef5f51e0861a904b74a694e621bb451fe7ae.tar.gz linux-stable-6013ef5f51e0861a904b74a694e621bb451fe7ae.tar.bz2 linux-stable-6013ef5f51e0861a904b74a694e621bb451fe7ae.zip |
arm64: mte: Ensure the cleared tags are visible before setting the PTE
commit 1d0cb4c8864addc362bae98e8ffa5500c87e1227 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/crypto')
0 files changed, 0 insertions, 0 deletions