[patch 04/14] remap_file_pages protection support: disallow mprotect() on manyprots mappings
- From: blaisorblade@xxxxxxxx
- Date: Sun, 30 Apr 2006 19:29:57 +0200
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
For now we (I and Hugh) have found no agreement on which behavior to implement
here. So, at least as a stop-gap, return an error here.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
Index: linux-2.6.git/mm/mprotect.c
===================================================================
--- linux-2.6.git.orig/mm/mprotect.c
+++ linux-2.6.git/mm/mprotect.c
@@ -217,6 +217,13 @@ sys_mprotect(unsigned long start, size_t
error = -ENOMEM;
if (!vma)
goto out;
+
+ /* If a need is felt, an appropriate behaviour may be implemented for
+ * this case. We haven't agreed yet on which behavior is appropriate. */
+ error = -EACCES;
+ if (vma->vm_flags & VM_MANYPROTS)
+ goto out;
+
if (unlikely(grows & PROT_GROWSDOWN)) {
if (vma->vm_start >= end)
goto out;
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [patch 00/14] remap_file_pages protection support
- From: blaisorblade
- [patch 00/14] remap_file_pages protection support
- Prev by Date: [patch 03/14] remap_file_pages protection support: handle MANYPROTS VMAs
- Next by Date: Re: [FYI] whitespace removal
- Previous by thread: [patch 03/14] remap_file_pages protection support: handle MANYPROTS VMAs
- Next by thread: [patch 08/14] remap_file_pages protection support: use FAULT_SIGSEGV for protection checking
- Index(es):
Relevant Pages
|