summaryrefslogtreecommitdiffstats
path: root/meta/packages/qemu
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-04-24 16:54:09 +0000
committerRichard Purdie <richard@openedhand.com>2008-04-24 16:54:09 +0000
commit0e1fe2007df82725e6ce46d4f92d8bf4434ee887 (patch)
tree8c6be983b34616340515174ac60d9d56f61b44ed /meta/packages/qemu
parent755df3ab5e279fd19c816b17195b07d8ed2973c4 (diff)
downloadpoky-0e1fe2007df82725e6ce46d4f92d8bf4434ee887.tar.gz
qemu: Add two qemu usermode fixes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4331 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/qemu')
-rw-r--r--meta/packages/qemu/qemu-0.9.1+svn/fix_brk.patch55
-rw-r--r--meta/packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch14
-rw-r--r--meta/packages/qemu/qemu_svn.bb4
3 files changed, 72 insertions, 1 deletions
diff --git a/meta/packages/qemu/qemu-0.9.1+svn/fix_brk.patch b/meta/packages/qemu/qemu-0.9.1+svn/fix_brk.patch
new file mode 100644
index 0000000000..783198d9e3
--- /dev/null
+++ b/meta/packages/qemu/qemu-0.9.1+svn/fix_brk.patch
@@ -0,0 +1,55 @@
1--- qemu/linux-user/syscall.c1 (revision 16)
2+++ qemu/linux-user/syscall.c (working copy)
3@@ -441,7 +441,7 @@
4 if (!new_brk)
5 return target_brk;
6 if (new_brk < target_original_brk)
7- return -TARGET_ENOMEM;
8+ return target_brk;
9
10 brk_page = HOST_PAGE_ALIGN(target_brk);
11
12@@ -456,12 +456,11 @@
13 mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size,
14 PROT_READ|PROT_WRITE,
15 MAP_ANON|MAP_FIXED|MAP_PRIVATE, 0, 0));
16- if (is_error(mapped_addr)) {
17- return mapped_addr;
18- } else {
19+
20+ if (!is_error(mapped_addr))
21 target_brk = new_brk;
22- return target_brk;
23- }
24+
25+ return target_brk;
26 }
27
28 static inline abi_long copy_from_user_fdset(fd_set *fds,
29--- qemu/linux-user/mmap.c1 (revision 16)
30+++ qemu/linux-user/mmap.c (working copy)
31@@ -260,6 +259,9 @@
32 host_start += offset - host_offset;
33 start = h2g(host_start);
34 } else {
35+ int flg;
36+ target_ulong addr;
37+
38 if (start & ~TARGET_PAGE_MASK) {
39 errno = EINVAL;
40 return -1;
41@@ -267,6 +269,14 @@
42 end = start + len;
43 real_end = HOST_PAGE_ALIGN(end);
44
45+ for(addr = real_start; addr < real_end; addr += TARGET_PAGE_SIZE) {
46+ flg = page_get_flags(addr);
47+ if( flg & PAGE_RESERVED ) {
48+ errno = ENXIO;
49+ return -1;
50+ }
51+ }
52+
53 /* worst case: we cannot map the file because the offset is not
54 aligned, so we read it */
55 if (!(flags & MAP_ANONYMOUS) &&
diff --git a/meta/packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch b/meta/packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch
new file mode 100644
index 0000000000..ee2b077602
--- /dev/null
+++ b/meta/packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch
@@ -0,0 +1,14 @@
1Index: qemu-0.9.1/linux-user/mmap.c
2===================================================================
3--- qemu-0.9.1.orig/linux-user/mmap.c 2008-04-16 14:10:26.000000000 +0100
4+++ qemu-0.9.1/linux-user/mmap.c 2008-04-16 14:10:51.000000000 +0100
5@@ -49,8 +49,7 @@
6 end = start + len;
7 if (end < start)
8 return -EINVAL;
9- if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC))
10- return -EINVAL;
11+ prot = prot & (PROT_READ | PROT_WRITE | PROT_EXEC);
12 if (len == 0)
13 return 0;
14
diff --git a/meta/packages/qemu/qemu_svn.bb b/meta/packages/qemu/qemu_svn.bb
index 0a55ba8736..802d47b71b 100644
--- a/meta/packages/qemu/qemu_svn.bb
+++ b/meta/packages/qemu/qemu_svn.bb
@@ -1,7 +1,7 @@
1LICENSE = "GPL" 1LICENSE = "GPL"
2DEPENDS = "zlib" 2DEPENDS = "zlib"
3PV = "0.9.1+svnr${SRCREV}" 3PV = "0.9.1+svnr${SRCREV}"
4PR = "r2" 4PR = "r3"
5 5
6FILESPATH = "${FILE_DIRNAME}/qemu-0.9.1+svn/" 6FILESPATH = "${FILE_DIRNAME}/qemu-0.9.1+svn/"
7 7
@@ -31,6 +31,8 @@ SRC_URI = "\
31 file://workaround_bad_futex_headers.patch;patch=1 \ 31 file://workaround_bad_futex_headers.patch;patch=1 \
32 file://fix_segfault.patch;patch=1 \ 32 file://fix_segfault.patch;patch=1 \
33 file://no-strip.patch;patch=1 \ 33 file://no-strip.patch;patch=1 \
34 file://fix_brk.patch;patch=1 \
35 file://fix_protection_bits.patch;patch=1 \
34 file://qemu-n800-support.patch;patch=1" 36 file://qemu-n800-support.patch;patch=1"
35 37
36S = "${WORKDIR}/trunk" 38S = "${WORKDIR}/trunk"