diff options
author | Will Deacon <will@kernel.org> | 2019-08-08 16:51:00 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-07 18:59:29 +0200 |
commit | 175f4efcb12ac85e5471cc0468e10a2d6db8a40f (patch) | |
tree | b0eaffa5e92c47125e9cbf3b350e1ebfa2a69a50 /net/tipc/node.h | |
parent | cf4e9c2472acf9e49377b8702028f822c7eff403 (diff) | |
download | linux-stable-175f4efcb12ac85e5471cc0468e10a2d6db8a40f.tar.gz linux-stable-175f4efcb12ac85e5471cc0468e10a2d6db8a40f.tar.bz2 linux-stable-175f4efcb12ac85e5471cc0468e10a2d6db8a40f.zip |
ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes
[ Upstream commit 834020366da9ab3fb87d1eb9a3160eb22dbed63a ]
Translation faults arising from cache maintenance instructions are
rather unhelpfully reported with an FSR value where the WnR field is set
to 1, indicating that the faulting access was a write. Since cache
maintenance instructions on 32-bit ARM do not require any particular
permissions, this can cause our private 'cacheflush' system call to fail
spuriously if a translation fault is generated due to page aging when
targetting a read-only VMA.
In this situation, we will return -EFAULT to userspace, although this is
unfortunately suppressed by the popular '__builtin___clear_cache()'
intrinsic provided by GCC, which returns void.
Although it's tempting to write this off as a userspace issue, we can
actually do a little bit better on CPUs that support LPAE, even if the
short-descriptor format is in use. On these CPUs, cache maintenance
faults additionally set the CM field in the FSR, which we can use to
suppress the write permission checks in the page fault handler and
succeed in performing cache maintenance to read-only areas even in the
presence of a translation fault.
Reported-by: Orion Hodson <oth@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/tipc/node.h')
0 files changed, 0 insertions, 0 deletions