aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2012-08-10 17:51:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 10:00:36 -0700
commit9a0417a2d4b082bede8c0495d14d8bb20afaa700 (patch)
tree283aad49cbeaf79cbfcd021fb7a1417cf7f7a1f2 /arch/arm/mm
parent33fe660ca2679c4d0234a49cffb82001a57ab003 (diff)
downloadkernel_samsung_smdk4412-9a0417a2d4b082bede8c0495d14d8bb20afaa700.zip
kernel_samsung_smdk4412-9a0417a2d4b082bede8c0495d14d8bb20afaa700.tar.gz
kernel_samsung_smdk4412-9a0417a2d4b082bede8c0495d14d8bb20afaa700.tar.bz2
ARM: 7487/1: mm: avoid setting nG bit for user mappings that aren't present
commit 47f1204329237a0f8655f5a9f14a38ac81946ca1 upstream. Swap entries are encoding in ptes such that !pte_present(pte) and pte_file(pte). The remaining bits of the descriptor are used to identify the swapfile and offset within it to the swap entry. When writing such a pte for a user virtual address, set_pte_at unconditionally sets the nG bit, which (in the case of LPAE) will corrupt the swapfile offset and lead to a BUG: [ 140.494067] swap_free: Unused swap offset entry 000763b4 [ 140.509989] BUG: Bad page map in process rs:main Q:Reg pte:0ec76800 pmd:8f92e003 This patch fixes the problem by only setting the nG bit for user mappings that are actually present. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/flush.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 1a8d4aa..8fda9f7 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -236,8 +236,6 @@ void __sync_icache_dcache(pte_t pteval)
struct page *page;
struct address_space *mapping;
- if (!pte_present_user(pteval))
- return;
if (cache_is_vipt_nonaliasing() && !pte_exec(pteval))
/* only flush non-aliasing VIPT caches for exec mappings */
return;