android_kernel_samsung_msm8976/mm
Kirill A. Shutemov f14fa330b7 mm: avoid setting up anonymous pages into file mapping
commit 6b7339f4c31ad69c8e9c0b2859276e22cf72176d upstream.

Reading page fault handler code I've noticed that under right
circumstances kernel would map anonymous pages into file mappings: if
the VMA doesn't have vm_ops->fault() and the VMA wasn't fully populated
on ->mmap(), kernel would handle page fault to not populated pte with
do_anonymous_page().

Let's change page fault handler to use do_anonymous_page() only on
anonymous VMA (->vm_ops == NULL) and make sure that the VMA is not
shared.

For file mappings without vm_ops->fault() or shred VMA without vm_ops,
page fault on pte_none() entry would lead to SIGBUS.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-repo: https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable
Git-commit: efcbc94afe
Change-Id: Ifab61dd2e0f503811ff428ab6b1d8ba62436e920
Signed-off-by: Srinivasa Rao Kuppala <srkupp@codeaurora.org>
2017-01-15 05:32:41 -08:00
..
kasan kasan, module, vmalloc: rework shadow allocation for modules 2015-05-04 14:03:58 -07:00
Kconfig BACKPORT: mm/zsmalloc: add statistics support 2016-05-18 14:35:51 +05:30
Kconfig.debug
Makefile BACKPORT: mm/zpool: implement common zpool api to zbud/zsmalloc 2016-05-18 14:35:03 +05:30
backing-dev.c
balloon_compaction.c
bootmem.c
bounce.c
cleancache.c
compaction.c mm: page_alloc: add kasan hooks on alloc and free paths 2015-05-04 14:03:54 -07:00
debug-pagealloc.c mm/debug-pagealloc.c: print page physical address for 2015-08-23 23:19:22 -07:00
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c Page cache miss tracing using ftrace on mm/filemap 2016-05-18 14:31:34 +05:30
filemap_xip.c
fremap.c
frontswap.c
highmem.c
huge_memory.c
hugetlb.c mm/hugetlb: add migration entry check in __unmap_hugepage_range 2015-03-18 13:22:27 +01:00
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c
internal.h mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
interval_tree.c
kmemcheck.c
kmemleak-test.c
kmemleak.c mm: kmemleak: allow safe memory scanning during kmemleak disabling 2015-06-22 10:47:32 +05:30
ksm.c This is the 3.10.84 stable release 2015-09-30 13:25:40 +05:30
maccess.c
madvise.c
memblock.c
memcontrol.c UPSTREAM: memcg: Only free spare array when readers are done 2016-05-18 14:36:06 +05:30
memory-failure.c This is the 3.10.84 stable release 2015-09-30 13:25:40 +05:30
memory.c mm: avoid setting up anonymous pages into file mapping 2017-01-15 05:32:41 -08:00
memory_hotplug.c This is the 3.10.84 stable release 2015-09-30 13:25:40 +05:30
mempolicy.c
mempool.c
memtest.c memtest: use phys_addr_t for physical addresses 2015-04-01 09:27:43 -07:00
migrate.c mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
mincore.c
mlock.c mm: reorder can_do_mlock to fix audit denial 2015-09-16 18:20:13 +05:30
mm_init.c
mmap.c FROMLIST: mm: mmap: Add new /proc tunable for mmap_base ASLR. 2016-05-18 14:36:00 +05:30
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c
msync.c
nobootmem.c
nommu.c This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
oom_kill.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
page-writeback.c This is the 3.10.84 stable release 2015-09-30 13:25:40 +05:30
page_alloc.c mm: fix compile time error with !CONFIG_CMA 2015-11-26 21:16:14 -08:00
page_cgroup.c
page_io.c
page_isolation.c mm/page_alloc: Call kernel_map_pages in unset_migrateype_isolate 2015-03-19 11:34:36 -07:00
pageowner.c
pagewalk.c mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range 2015-02-11 14:48:16 +08:00
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
process_reclaim.c lowmemorykiller: Introduce sysfs node for ALMK and PPR adj threshold 2016-07-06 23:07:02 -07:00
process_vm_access.c
quicklist.c
readahead.c
rmap.c mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
shmem.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
showmem.c mm: showmem: make the notifiers atomic 2015-06-05 13:54:50 +05:30
slab.c mm: slub: add kernel address sanitizer support for slub allocator 2015-05-04 14:03:56 -07:00
slab.h
slab_common.c mm: slub: add kernel address sanitizer support for slub allocator 2015-05-04 14:03:56 -07:00
slob.c
slub.c mm: slub: add kernel address sanitizer support for slub allocator 2015-05-04 14:03:56 -07:00
sparse-vmemmap.c
sparse.c
swap.c
swap_state.c Merge "lowmemorykiller: Don't count swap cache pages twice" 2015-04-09 06:38:02 -07:00
swapfile.c BACKPORT: mm: /proc/pid/smaps:: show proportional swap share of the mapping 2016-05-18 14:35:57 +05:30
truncate.c
util.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
vmalloc.c bludgeon the flounder kernel until it builds on i386 for qemu testing 2015-09-16 18:20:19 +05:30
vmpressure.c mm: vmpressure: account allocstalls only on higher pressures 2015-08-25 18:34:09 -07:00
vmscan.c vmscan: fix increasing nr_isolated incurred by putback unevictable pages 2015-08-30 20:50:58 -07:00
vmstat.c Revert "Revert "mm: add cma pcp list"" 2015-06-25 13:10:46 -07:00
zbud.c
zpool.c BACKPORT: mm/zpool: add name argument to create zpool 2016-05-18 14:35:51 +05:30
zsmalloc.c UPSTREAM: zsmalloc: fix a null pointer dereference in destroy_handle_cache() 2016-05-18 14:35:56 +05:30
zswap.c