public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 11/39] remap_file_pages protection support: add MAP_NOINHERIT flag
@ 2005-08-12 17:31 blaisorblade
  0 siblings, 0 replies; 4+ messages in thread
From: blaisorblade @ 2005-08-12 17:31 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, mingo, blaisorblade


From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Add the MAP_NOINHERIT flag to arch headers, for use with remap-file-pages.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 linux-2.6.git-paolo/include/asm-i386/mman.h   |    1 +
 linux-2.6.git-paolo/include/asm-ia64/mman.h   |    1 +
 linux-2.6.git-paolo/include/asm-ppc/mman.h    |    1 +
 linux-2.6.git-paolo/include/asm-ppc64/mman.h  |    1 +
 linux-2.6.git-paolo/include/asm-s390/mman.h   |    1 +
 linux-2.6.git-paolo/include/asm-x86_64/mman.h |    1 +
 6 files changed, 6 insertions(+)

diff -puN include/asm-i386/mman.h~rfp-map-noinherit include/asm-i386/mman.h
--- linux-2.6.git/include/asm-i386/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-i386/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -22,6 +22,7 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-ia64/mman.h~rfp-map-noinherit include/asm-ia64/mman.h
--- linux-2.6.git/include/asm-ia64/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-ia64/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -30,6 +30,7 @@
 #define MAP_NORESERVE	0x04000		/* don't check for reservations */
 #define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-ppc64/mman.h~rfp-map-noinherit include/asm-ppc64/mman.h
--- linux-2.6.git/include/asm-ppc64/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-ppc64/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -38,6 +38,7 @@
 
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MADV_NORMAL	0x0		/* default page-in behavior */
 #define MADV_RANDOM	0x1		/* page-in minimum required */
diff -puN include/asm-ppc/mman.h~rfp-map-noinherit include/asm-ppc/mman.h
--- linux-2.6.git/include/asm-ppc/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-ppc/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -23,6 +23,7 @@
 #define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-s390/mman.h~rfp-map-noinherit include/asm-s390/mman.h
--- linux-2.6.git/include/asm-s390/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-s390/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -30,6 +30,7 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-x86_64/mman.h~rfp-map-noinherit include/asm-x86_64/mman.h
--- linux-2.6.git/include/asm-x86_64/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-x86_64/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -23,6 +23,7 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
_

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 11/39] remap_file_pages protection support: add MAP_NOINHERIT flag
@ 2005-08-12 18:21 blaisorblade
  2005-08-12 19:43 ` Russell King
  0 siblings, 1 reply; 4+ messages in thread
From: blaisorblade @ 2005-08-12 18:21 UTC (permalink / raw)
  To: akpm; +Cc: jdike, linux-kernel, user-mode-linux-devel, blaisorblade


From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Add the MAP_NOINHERIT flag to arch headers, for use with remap-file-pages.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 linux-2.6.git-paolo/include/asm-i386/mman.h   |    1 +
 linux-2.6.git-paolo/include/asm-ia64/mman.h   |    1 +
 linux-2.6.git-paolo/include/asm-ppc/mman.h    |    1 +
 linux-2.6.git-paolo/include/asm-ppc64/mman.h  |    1 +
 linux-2.6.git-paolo/include/asm-s390/mman.h   |    1 +
 linux-2.6.git-paolo/include/asm-x86_64/mman.h |    1 +
 6 files changed, 6 insertions(+)

diff -puN include/asm-i386/mman.h~rfp-map-noinherit include/asm-i386/mman.h
--- linux-2.6.git/include/asm-i386/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-i386/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -22,6 +22,7 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-ia64/mman.h~rfp-map-noinherit include/asm-ia64/mman.h
--- linux-2.6.git/include/asm-ia64/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-ia64/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -30,6 +30,7 @@
 #define MAP_NORESERVE	0x04000		/* don't check for reservations */
 #define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-ppc64/mman.h~rfp-map-noinherit include/asm-ppc64/mman.h
--- linux-2.6.git/include/asm-ppc64/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-ppc64/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -38,6 +38,7 @@
 
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MADV_NORMAL	0x0		/* default page-in behavior */
 #define MADV_RANDOM	0x1		/* page-in minimum required */
diff -puN include/asm-ppc/mman.h~rfp-map-noinherit include/asm-ppc/mman.h
--- linux-2.6.git/include/asm-ppc/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-ppc/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -23,6 +23,7 @@
 #define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-s390/mman.h~rfp-map-noinherit include/asm-s390/mman.h
--- linux-2.6.git/include/asm-s390/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-s390/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -30,6 +30,7 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff -puN include/asm-x86_64/mman.h~rfp-map-noinherit include/asm-x86_64/mman.h
--- linux-2.6.git/include/asm-x86_64/mman.h~rfp-map-noinherit	2005-08-11 12:06:40.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-x86_64/mman.h	2005-08-11 12:06:40.000000000 +0200
@@ -23,6 +23,7 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_NOINHERIT	0x20000		/* don't inherit the protection bits of the underlying vma*/
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
_

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 11/39] remap_file_pages protection support: add MAP_NOINHERIT flag
  2005-08-12 18:21 [patch 11/39] remap_file_pages protection support: add MAP_NOINHERIT flag blaisorblade
@ 2005-08-12 19:43 ` Russell King
  2005-08-22 16:06   ` [uml-devel] " Blaisorblade
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King @ 2005-08-12 19:43 UTC (permalink / raw)
  To: blaisorblade; +Cc: akpm, jdike, linux-kernel, user-mode-linux-devel

On Fri, Aug 12, 2005 at 08:21:23PM +0200, blaisorblade@yahoo.it wrote:
> From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
> 
> Add the MAP_NOINHERIT flag to arch headers, for use with remap-file-pages.

Does this mean ARM will break when these patches are merged?

> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
> ---
> 
>  linux-2.6.git-paolo/include/asm-i386/mman.h   |    1 +
>  linux-2.6.git-paolo/include/asm-ia64/mman.h   |    1 +
>  linux-2.6.git-paolo/include/asm-ppc/mman.h    |    1 +
>  linux-2.6.git-paolo/include/asm-ppc64/mman.h  |    1 +
>  linux-2.6.git-paolo/include/asm-s390/mman.h   |    1 +
>  linux-2.6.git-paolo/include/asm-x86_64/mman.h |    1 +
>  6 files changed, 6 insertions(+)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] Re: [patch 11/39] remap_file_pages protection support: add MAP_NOINHERIT flag
  2005-08-12 19:43 ` Russell King
@ 2005-08-22 16:06   ` Blaisorblade
  0 siblings, 0 replies; 4+ messages in thread
From: Blaisorblade @ 2005-08-22 16:06 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Russell King, akpm, jdike, linux-kernel

On Friday 12 August 2005 21:43, Russell King wrote:
> On Fri, Aug 12, 2005 at 08:21:23PM +0200, blaisorblade@yahoo.it wrote:
> > From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
> >
> > Add the MAP_NOINHERIT flag to arch headers, for use with
> > remap-file-pages.

> Does this mean ARM will break when these patches are merged?
Sorry for missing answer, I was disconnected.

Well, when they'll be merged in -mm you(and other archs) will see a bit of 
things screwing up, but *this* patch is trivial to port to all archs.

The real problem will be updating the PTE encoding macros (see pte_file and 
sys_remap_file_pages) to also store the page protections. Or at least pretend 
they do - things won't compile otherwise.

However, those patches stayed around in -mm for a while, since 2.6.4-rc2-mm1 
to 2.6.5-mm1, so the (basic) fixes will be of the same kind.

VM_FAULT_SIGSEGV is much more though, however. When VMA pages can change 
protection, permission checking must move to the generic VM. See patches for 
i386 about that (patches for other architectures are compile-only, and don't 
handle properly this aspect).

However, don't worry for now, we'll be discussing this on next try. Mass arch 
updating will happen after the patch has been set into its definitive shape.
-- 
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

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-08-22 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-12 18:21 [patch 11/39] remap_file_pages protection support: add MAP_NOINHERIT flag blaisorblade
2005-08-12 19:43 ` Russell King
2005-08-22 16:06   ` [uml-devel] " Blaisorblade
  -- strict thread matches above, loose matches on Subject: below --
2005-08-12 17:31 blaisorblade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox