lkml.org 
[lkml]   [2003]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Alternate futex non-page-pinning and COW fix
Linus Torvalds wrote:
> Actually: the VM_SHARED flag will never change, so testing VM_SHARED is
> actually the _right_ thing from a mm perspective.

Yes it can. See sys_mprotect(). If that's not intended, it's a bug
in mprotect(). What does PROT_SEM mean for Linux, btw?

See:
if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM))
return -EINVAL;

and:
newflags = prot | (vma->vm_flags & ~(PROT_READ | PROT_WRITE | PROT_EXEC));
if ((newflags & ~(newflags >> 4)) & 0xf) {
error = -EACCES;
goto out;
}

newflags is than used to index protection_map[], like this:
newprot = protection_map[newflags & 0xf];

and that is stored in the page tables.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.265 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site