]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Jan 2019 10:32:13 +0000 (11:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Jan 2019 10:32:13 +0000 (11:32 +0100)
added patches:
arm64-mm-remove-page_mapping-check-in-__sync_icache_dcache.patch

queue-4.4/arm64-mm-remove-page_mapping-check-in-__sync_icache_dcache.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/arm64-mm-remove-page_mapping-check-in-__sync_icache_dcache.patch b/queue-4.4/arm64-mm-remove-page_mapping-check-in-__sync_icache_dcache.patch
new file mode 100644 (file)
index 0000000..83e406b
--- /dev/null
@@ -0,0 +1,50 @@
+From 0868e8dd6384e454c4de80dad9167d48a9ca2987 Mon Sep 17 00:00:00 2001
+From: Shaokun Zhang <zhangshaokun@hisilicon.com>
+Date: Tue, 21 Jun 2016 15:32:57 +0800
+Subject: arm64: mm: remove page_mapping check in __sync_icache_dcache
+
+From: Shaokun Zhang <zhangshaokun@hisilicon.com>
+
+commit 20c27a4270c775d7ed661491af8ac03264d60fc6 upstream.
+
+__sync_icache_dcache unconditionally skips the cache maintenance for
+anonymous pages, under the assumption that flushing is only required in
+the presence of D-side aliases [see 7249b79f6b4cc ("arm64: Do not flush
+the D-cache for anonymous pages")].
+
+Unfortunately, this breaks migration of anonymous pages holding
+self-modifying code, where userspace cannot be reasonably expected to
+reissue maintenance instructions in response to a migration.
+
+This patch fixes the problem by removing the broken page_mapping(page)
+check from the cache syncing code, otherwise we may end up fetching and
+executing stale instructions from the PoU.
+
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Will Deacon <will.deacon@arm.com>
+Cc: Mark Rutland <mark.rutland@arm.com>
+Cc: <stable@vger.kernel.org>
+Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
+Cc: Amanieu d'Antras <amanieu@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm64/mm/flush.c |    4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/arch/arm64/mm/flush.c
++++ b/arch/arm64/mm/flush.c
+@@ -70,10 +70,6 @@ void __sync_icache_dcache(pte_t pte, uns
+ {
+       struct page *page = pte_page(pte);
+-      /* no flushing needed for anonymous pages */
+-      if (!page_mapping(page))
+-              return;
+-
+       if (!test_and_set_bit(PG_dcache_clean, &page->flags)) {
+               __flush_dcache_area(page_address(page),
+                               PAGE_SIZE << compound_order(page));
index 17200ee9ed4b9c0216f366f0248939306f353c39..e08c1c690d4f5e715be0bc6c064c3a47a40fca82 100644 (file)
@@ -25,3 +25,4 @@ perf-unwind-unwind-with-libdw-doesn-t-take-symfs-int.patch
 perf-unwind-take-pgoff-into-account-when-reporting-e.patch
 irqchip-gic-v3-its-align-pci-multi-msi-allocation-on-their-size.patch
 s390-smp-fix-calling-smp_call_ipl_cpu-from-ipl-cpu.patch
+arm64-mm-remove-page_mapping-check-in-__sync_icache_dcache.patch