From: Greg Kroah-Hartman Date: Tue, 29 Jan 2019 10:32:13 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.9.154~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b8332d6562e323ce87ceffed31fcb4a74ba3c8e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: arm64-mm-remove-page_mapping-check-in-__sync_icache_dcache.patch --- 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 index 00000000000..83e406b6d29 --- /dev/null +++ b/queue-4.4/arm64-mm-remove-page_mapping-check-in-__sync_icache_dcache.patch @@ -0,0 +1,50 @@ +From 0868e8dd6384e454c4de80dad9167d48a9ca2987 Mon Sep 17 00:00:00 2001 +From: Shaokun Zhang +Date: Tue, 21 Jun 2016 15:32:57 +0800 +Subject: arm64: mm: remove page_mapping check in __sync_icache_dcache + +From: Shaokun Zhang + +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 +Cc: Will Deacon +Cc: Mark Rutland +Cc: +Reviewed-by: Catalin Marinas +Signed-off-by: Shaokun Zhang +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +Cc: Amanieu d'Antras +Signed-off-by: Greg Kroah-Hartman + +--- + 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)); diff --git a/queue-4.4/series b/queue-4.4/series index 17200ee9ed4..e08c1c690d4 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -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