+ nommu-fix-execution-off-of-ramfs-with-mmap.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     NOMMU: Fix execution off of ramfs with mmap()

has been added to the -mm tree.  Its filename is

     nommu-fix-execution-off-of-ramfs-with-mmap.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: NOMMU: Fix execution off of ramfs with mmap()
From: David Howells <dhowells@xxxxxxxxxx>

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@xxxxxxxxxx>
Cc: Hugh Dickins <hugh@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/ramfs/file-nommu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN fs/ramfs/file-nommu.c~nommu-fix-execution-off-of-ramfs-with-mmap fs/ramfs/file-nommu.c
--- a/fs/ramfs/file-nommu.c~nommu-fix-execution-off-of-ramfs-with-mmap
+++ a/fs/ramfs/file-nommu.c
@@ -283,9 +283,9 @@ unsigned long ramfs_nommu_get_unmapped_a
 
 /*****************************************************************************/
 /*
- * set up a mapping
+ * set up a mapping for shared memory segments
  */
 int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma)
 {
-	return 0;
+	return vma->vm_flags & VM_SHARED ? 0 : -ENOSYS;
 }
_

Patches currently in -mm which might be from dhowells@xxxxxxxxxx are

origin.patch
git-gfs2.patch
fdpic-fix-fdpic-compile-errors.patch
frv-fix-frv-arch-compile-errors.patch
nommu-fix-execution-off-of-ramfs-with-mmap.patch
fdpic-add-coredump-capability-for-the-elf-fdpic-binfmt.patch
fdpic-add-coredump-capability-for-the-elf-fdpic-binfmt-cleanup.patch
frv-introduce-asm-offsets-for-frv-arch.patch
lockdep-add-more-rwsemh-documentation.patch
vfs-documentation-tweak.patch
ecryptfs-get_sb_dev-fix.patch
reiser4-get_sb_dev-fix.patch
mutex-subsystem-synchro-test-module.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux