Revision 6b7339f4c31ad69c8e9c0b2859276e22cf72176d authored by Kirill A. Shutemov on 06 July 2015, 20:18:37 UTC, committed by Linus Torvalds on 09 July 2015, 18:12:48 UTC
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>
1 parent 883a2df
Raw File
Kconfig
config FUSE_FS
	tristate "FUSE (Filesystem in Userspace) support"
	help
	  With FUSE it is possible to implement a fully functional filesystem
	  in a userspace program.

	  There's also a companion library: libfuse2.  This library is available
	  from the FUSE homepage:
	  <http://fuse.sourceforge.net/>
	  although chances are your distribution already has that library
	  installed if you've installed the "fuse" package itself.

	  See <file:Documentation/filesystems/fuse.txt> for more information.
	  See <file:Documentation/Changes> for needed library/utility version.

	  If you want to develop a userspace FS, or if you want to use
	  a filesystem based on FUSE, answer Y or M.

config CUSE
	tristate "Character device in Userspace support"
	depends on FUSE_FS
	help
	  This FUSE extension allows character devices to be
	  implemented in userspace.

	  If you want to develop or use a userspace character device
	  based on CUSE, answer Y or M.
back to top