From d192ad85aae5731f564063c93aebe2414b9e11b4 Mon Sep 17 00:00:00 2001 From: Juergen Lock Date: Sun, 30 May 2010 19:22:32 +0000 Subject: - Avoid using mmap MAP_ANON with a non-zero offset. [1] - Bump PORTREVISION. PR: kern/71258 [1] --- emulators/qemu/files/patch-osdep.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'emulators/qemu/files/patch-osdep.c') diff --git a/emulators/qemu/files/patch-osdep.c b/emulators/qemu/files/patch-osdep.c index 984c63bdbbcb..a1b7cadcb08a 100644 --- a/emulators/qemu/files/patch-osdep.c +++ b/emulators/qemu/files/patch-osdep.c @@ -1,5 +1,5 @@ Index: qemu/osdep.c -@@ -179,7 +179,9 @@ +@@ -179,13 +179,15 @@ static void *kqemu_vmalloc(size_t size) } unlink(phys_ram_file); } @@ -9,3 +9,10 @@ Index: qemu/osdep.c ftruncate(phys_ram_fd, phys_ram_size + size); #endif /* !(__OpenBSD__ || __FreeBSD__ || __DragonFly__) */ ptr = mmap(NULL, + size, + PROT_WRITE | PROT_READ, map_anon | MAP_SHARED, +- phys_ram_fd, phys_ram_size); ++ phys_ram_fd, map_anon ? 0 : phys_ram_size); + if (ptr == MAP_FAILED) { + fprintf(stderr, "Could not map physical memory\n"); + exit(1); -- cgit v1.2.3