diff options
author | Vinayak Menon <vinmenon@codeaurora.org> | 2016-11-08 11:49:15 +0530 |
---|---|---|
committer | Vinayak Menon <vinmenon@codeaurora.org> | 2016-11-18 18:46:27 +0530 |
commit | 6b18be5a733fa378754f0e6383365465d5db1f86 (patch) | |
tree | e42506f766463b33bd8b1926d747a444ec1f0702 /crypto/crypto_user.c | |
parent | a2e9bdc989a9cb42dce5ae027cd6fdc1003f376b (diff) |
arm64: avoid segfault on el0 cache maintenance
It is found that "dc civac" from el0 on a non-COW RO VA results in a
segmentation fault, while as per ARM ARM, for el0 only read access
permission is needed on a VA to perform clean and invalidate. This bug
was introduced by commit 3fbe6bc28a6b ("arm64: Allow cache maintenance
operations to trigger write faults"), which enabled write faults on all
cache maintenance faults.
The original intention of the above commit was to trigger write faults
only for cache maintenance operations performed by EL1 on user VA. But
it introduced this side effect of generating a write fault on EL0 cache
maintenance ops also when a read permission is sufficient for operation
to succeed. This results in a segmentation fault when the VA is part of
region marked as PROT_READ.
So trigger write faults only when the cache maintenance fault is generated
in non-user mode. Still, there can be a case where kernel performs a cache
maintenance op on a PROT_READ mapped VA which will result in a kernel
fault. But that looks invalid since there is no need for a kernel driver
to perform a cache maintenance on a RO buffer and such cases if they exist
need to be fixed.
Change-Id: I001ca0473c37fcf713201386b5ed6a6244f6b37d
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Diffstat (limited to 'crypto/crypto_user.c')
0 files changed, 0 insertions, 0 deletions