1
0
Fork 0
remarkable-linux/arch/x86
Jan Kara 1b7ff5208d mm: Preserve _PAGE_DEVMAP across mprotect() calls
commit 4628a64591 upstream.

Currently _PAGE_DEVMAP bit is not preserved in mprotect(2) calls. As a
result we will see warnings such as:

BUG: Bad page map in process JobWrk0013  pte:800001803875ea25 pmd:7624381067
addr:00007f0930720000 vm_flags:280000f9 anon_vma:          (null) mapping:ffff97f2384056f0 index:0
file:457-000000fe00000030-00000009-000000ca-00000001_2001.fileblock fault:xfs_filemap_fault [xfs] mmap:xfs_file_mmap [xfs] readpage:          (null)
CPU: 3 PID: 15848 Comm: JobWrk0013 Tainted: G        W          4.12.14-2.g7573215-default #1 SLE12-SP4 (unreleased)
Hardware name: Intel Corporation S2600WFD/S2600WFD, BIOS SE5C620.86B.01.00.0833.051120182255 05/11/2018
Call Trace:
 dump_stack+0x5a/0x75
 print_bad_pte+0x217/0x2c0
 ? enqueue_task_fair+0x76/0x9f0
 _vm_normal_page+0xe5/0x100
 zap_pte_range+0x148/0x740
 unmap_page_range+0x39a/0x4b0
 unmap_vmas+0x42/0x90
 unmap_region+0x99/0xf0
 ? vma_gap_callbacks_rotate+0x1a/0x20
 do_munmap+0x255/0x3a0
 vm_munmap+0x54/0x80
 SyS_munmap+0x1d/0x30
 do_syscall_64+0x74/0x150
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
...

when mprotect(2) gets used on DAX mappings. Also there is a wide variety
of other failures that can result from the missing _PAGE_DEVMAP flag
when the area gets used by get_user_pages() later.

Fix the problem by including _PAGE_DEVMAP in a set of flags that get
preserved by mprotect(2).

Fixes: 69660fd797 ("x86, mm: introduce _PAGE_DEVMAP")
Fixes: ebd3119793 ("powerpc/mm: Add devmap support for ppc64")
Cc: <stable@vger.kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-18 09:16:25 +02:00
..
boot x86/boot: Fix if_changed build flip/flop bug 2018-09-05 09:26:29 +02:00
configs x86/unwind: Rename unwinder config options to 'CONFIG_UNWINDER_*' 2017-12-25 14:26:13 +01:00
crypto crypto: x86/sha256-mb - fix digest copy in sha256_mb_mgr_get_comp_job_avx2() 2018-08-17 21:01:10 +02:00
entry x86/vdso: Fix vDSO syscall fallback asm constraint regression 2018-10-13 09:27:24 +02:00
events perf/x86/intel: Add support/quirk for the MISPREDICT bit on Knights Landing CPUs 2018-10-10 08:54:25 +02:00
hyperv x86/hyperv: Check for required priviliges in hyperv_init() 2018-04-26 11:02:13 +02:00
ia32 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
include mm: Preserve _PAGE_DEVMAP across mprotect() calls 2018-10-18 09:16:25 +02:00
kernel x86/mm: Expand static page table for fixmap space 2018-10-03 17:00:54 -07:00
kvm x86/kvm/lapic: always disable MMIO interface in x2APIC mode 2018-10-18 09:16:23 +02:00
lib x86/nmi: Fix NMI uaccess race against CR3 switching 2018-09-05 09:26:39 +02:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm x86/pti: Fix section mismatch warning/error 2018-10-03 17:01:00 -07:00
net bpf, x64: fix memleak when not converging after image 2018-06-21 04:02:52 +09:00
oprofile x86/oprofile: Fix bogus GCC-8 warning in nmi_setup() 2018-02-28 10:19:41 +01:00
pci x86/PCI: Make broadcom_postcore_init() check acpi_disabled 2017-12-14 09:52:53 +01:00
platform x86/irq: Let interrupt handlers set kvm_cpu_l1tf_flush_l1d 2018-08-15 18:12:58 +02:00
power x86/power: Fix swsusp_arch_resume prototype 2018-04-26 11:02:16 +02:00
purgatory License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ras License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
realmode x86-64/realmode: Add instruction suffix 2018-03-15 10:54:36 +01:00
tools x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 2018-03-19 08:42:44 +01:00
um um: Use POSIX ucontext_t instead of struct ucontext 2018-04-24 09:36:33 +02:00
video x86/video: Don't assume all FB devices are PCI devices 2016-03-15 11:08:26 +01:00
xen x86/mm: Expand static page table for fixmap space 2018-10-03 17:00:54 -07:00
.gitignore
Kbuild Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-09-07 09:25:15 -07:00
Kconfig mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE 2018-09-05 09:26:37 +02:00
Kconfig.cpu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig.debug x86/unwind: Make CONFIG_UNWINDER_ORC=y the default in kconfig for 64-bit 2017-12-25 14:26:14 +01:00
Makefile x86/build/64: Force the linker to use 2MB page size 2018-03-28 18:24:47 +02:00
Makefile.um License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile_32.cpu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00