]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] NOMMU: Fix execution off of ramfs with mmap()
authorDavid Howells <dhowells@redhat.com>
Mon, 10 Jul 2006 11:44:52 +0000 (04:44 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:21 +0000 (13:24 -0700)
commitb70d30c1980fb209c463608ea6983d91d8469759
tree9c131cd6bf337a9da98f31703214385c07571c38
parent06e648289546cf2ebf577beea3b3c04ac770f3d9
[PATCH] NOMMU: Fix execution off of ramfs with mmap()

Fix execution through the FDPIC binfmt of programs stored on ramfs by
preventing the ramfs mmap() returning successfully on a private mapping of
a ramfs file.  This causes NOMMU mmap to make a copy of the mapped portion
of the file and map that instead.

This could be improved by granting direct mapping access to read-only
private mappings for which the data is stored on a contiguous run of pages.
 However, this is only likely to be the case if the file was extended with
truncate before being written.

ramfs is left to map the file directly for shared mappings so that SYSV IPC
and POSIX shared memory both still work.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ramfs/file-nommu.c