Revert "Revert "BACKPORT: mm: avoid setting up anonymous pages into file mapping""

This reverts commit 29d7a7846becacc8af7e0cd3bff1e9d2c0804fe7.

Reason for revert: The underlying problem has been merged into R56 as per the bug report.

Original change's description:
> Revert "BACKPORT: mm: avoid setting up anonymous pages into file mapping"
> 
> This reverts commit cedc783822d2ff1f67b56cd0e565a4183737f575.
> 
> Reason for revert: The patch causes older versions of Chrome (the version available in R56) to crash.
> 
> Original change's description:
> > BACKPORT: mm: avoid setting up anonymous pages into file mapping
> > 
> > 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.
> > 
> > BUG=chromium:679484
> > TEST=Build image and test normal operation
> > 
> > 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>
> > (cherry picked from commit 6b7339f4c31ad69c8e9c0b2859276e22cf72176d)
> > Signed-off-by: Guenter Roeck <groeck@chromium.org>
> > 
> > Change-Id: Icdca9048f80f6d7201b6d9887c58cbb750ffb721
> > Reviewed-on: https://chromium-review.googlesource.com/425791
> > Commit-Ready: Guenter Roeck <groeck@chromium.org>
> > Tested-by: Guenter Roeck <groeck@chromium.org>
> > Reviewed-by: Guenter Roeck <groeck@chromium.org>
> > (cherry picked from commit b8de00e1aab5008f186853f9608089c8c0b13a02)
> > Reviewed-on: https://chromium-review.googlesource.com/428447
> > Commit-Queue: Guenter Roeck <groeck@chromium.org>
> > 
> 
> TBR=groeck@chromium.org
> # Not skipping CQ checks because original CL landed > 1 day ago.
> BUG=chromium:679484, chrome-os-partner:62262
> TEST=Resize window in Chrome hangout session without crash
> 
> Change-Id: Ic0f1efc8dcfa2d435a6e04962b1f6e15b66379a2
> Signed-off-by: Guenter Roeck <groeck@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/438818
> 

TBR=groeck@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
BUG=chromium:679484, chrome-os-partner:62262

Change-Id: I8fdfb6e1e5e134ec9c309cf2cc08dcd936b0a63e
Reviewed-on: https://chromium-review.googlesource.com/439718
Trybot-Ready: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
1 file changed