[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#503821: Purpose of features/all/xen/workaround-pte-file.patch?



On Tue, Nov 04, 2008 at 08:30:16AM +0000, Ian Campbell wrote:
> However I assume the workaround is there for a specific purpose, what
> was it?

A crash in mprotect.

| #include <stdio.h>
| #include <stdlib.h>
| #include <sys/mman.h>
|
| const int size = 4096;
|
| int main()
| {
|   char *buf = mmap(0, size * 4, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|   mprotect(buf, size, PROT_NONE);
|   mprotect(buf, size, PROT_READ);
|   printf("%d\n", buf[0]);
| }

Bastian

-- 
Earth -- mother of the most beautiful women in the universe.
		-- Apollo, "Who Mourns for Adonais?" stardate 3468.1



Reply to: