2002-01-17 18:48:52

by David Engebretsen

[permalink] [raw]
Subject: [PATCH] vm_page_prot value

Following is a patch against 2.4.18-pre3 which fixes a problem where the
protection on user stack pages are not marked executable even though
the flags indicate the page is executable. Some more aggressive cache
flush optimizations may rely on the execution marking to indicate if a page
needs to be flushed as it might be present in an icache which is not
coherent with the dcache.

Pat Mccarthy, Don Reed, Dave Engebretsen


diff -Naur linux.orig/fs/exec.c linuxppc64_2_4/fs/exec.c
--- linux.orig/fs/exec.c Fri Dec 21 11:41:55 2001
+++ linuxppc64_2_4/fs/exec.c Thu Jan 10 11:32:48 2002
@@ -313,7 +312,7 @@
mpnt->vm_mm = current->mm;
mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
mpnt->vm_end = STACK_TOP;
- mpnt->vm_page_prot = PAGE_COPY;
+ mpnt->vm_page_prot = protection_map[VM_STACK_FLAGS & 0xf];
mpnt->vm_flags = VM_STACK_FLAGS;
mpnt->vm_ops = NULL;
mpnt->vm_pgoff = 0;


2002-01-17 21:18:10

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] vm_page_prot value

From: David Engebretsen <[email protected]>
Date: Thu, 17 Jan 2002 12:47:45 -0600

Following is a patch against 2.4.18-pre3 which fixes a problem where the
protection on user stack pages are not marked executable even though
the flags indicate the page is executable. Some more aggressive cache
flush optimizations may rely on the execution marking to indicate if a page
needs to be flushed as it might be present in an icache which is not
coherent with the dcache.

Actually, PAGE_COPY happens to be executable on many platforms.