> 2.0 is definitely consistent. (or should be)
buf = malloc(8192+4095) & -4095; /* two pages */
mprotect(&buf[4096],4096,PROT_NONE); /* second page no good */
read(fd,buf,8192);
under 2.0.x, this will ALWAYS fail.
under 2.1.x - this will never fail, it reads either the entire file
if its less than 4k or the first 4k - advancing the file pointer.
> ? we have not changed any semantics.
see above. (the details might not be exact, I have code to show this
though, I'll dig it up if you want)
> this is what i'm talking about. If the driver is buggy and doesnt
> return -EFAULT then user-space has no chance to catch the fault on
> the PROT_NONE.
drivers should return EFAULT if memory is bogus - and we can require
that because we can decide how the OS <-> driver interface should
look.
We cannot so easily defined how userspace code reacts to passing bad
pointers though.
-cw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/