diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-16 19:04:42 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-17 11:01:17 +0000 |
| commit | 2e4eaa57012425a5ea2d39c1e3ef3c22e3b32ce8 (patch) | |
| tree | 179d61cc8143a2d3c6e98a15645168313ae9189d /meta | |
| parent | 35fb71f38fc3070477bf125030b853c2bccd9f48 (diff) | |
| download | poky-2e4eaa57012425a5ea2d39c1e3ef3c22e3b32ce8.tar.gz | |
qemu: Refresh mmap fixes patch status/content
One mmap patch was merged upstream, the other is in progress but after
discussion has been amended and resent. Update the patches as such.
(From OE-Core rev: c68349a3334542e51f6c1c23f4f4342e4fce2b81)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/mmap.patch | 2 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/mmap2.patch | 26 |
2 files changed, 21 insertions, 7 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/mmap.patch b/meta/recipes-devtools/qemu/qemu/mmap.patch index 0f7d2ce04c..edd9734f30 100644 --- a/meta/recipes-devtools/qemu/qemu/mmap.patch +++ b/meta/recipes-devtools/qemu/qemu/mmap.patch | |||
| @@ -9,7 +9,7 @@ avoid asserting binaries when reserved_va is set. | |||
| 9 | This meant a test case now gives the same behaviour regardless of whether | 9 | This meant a test case now gives the same behaviour regardless of whether |
| 10 | reserved_va is set or not. | 10 | reserved_va is set or not. |
| 11 | 11 | ||
| 12 | Upstream-Status: Pending | 12 | Upstream-Status: Backport [https://github.com/qemu/qemu/commit/ccc5ccc17f8cfbfd87d9aede5d12a2d47c56e712] |
| 13 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org | 13 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org |
| 14 | 14 | ||
| 15 | Index: qemu-5.2.0/linux-user/mmap.c | 15 | Index: qemu-5.2.0/linux-user/mmap.c |
diff --git a/meta/recipes-devtools/qemu/qemu/mmap2.patch b/meta/recipes-devtools/qemu/qemu/mmap2.patch index 9d40565938..1652131757 100644 --- a/meta/recipes-devtools/qemu/qemu/mmap2.patch +++ b/meta/recipes-devtools/qemu/qemu/mmap2.patch | |||
| @@ -6,21 +6,35 @@ if it only sees ENOMEM and only exits when it hits EFAULT. | |||
| 6 | 6 | ||
| 7 | According to the docs, trying to mremap outside the address space | 7 | According to the docs, trying to mremap outside the address space |
| 8 | can/should return EFAULT and changing this allows the build to succeed. | 8 | can/should return EFAULT and changing this allows the build to succeed. |
| 9 | Whether this should be fixed in qemu and/or musl, not sure. | ||
| 10 | 9 | ||
| 11 | Upstream-Status: Pending | 10 | A better return value for the other cases of invalid addresses is EINVAL |
| 11 | rather than ENOMEM so adjust the other part of the test to this. | ||
| 12 | |||
| 13 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg01355.html] | ||
| 12 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org | 14 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org |
| 13 | 15 | ||
| 14 | Index: qemu-5.2.0/linux-user/mmap.c | 16 | Index: qemu-5.2.0/linux-user/mmap.c |
| 15 | =================================================================== | 17 | =================================================================== |
| 16 | --- qemu-5.2.0.orig/linux-user/mmap.c | 18 | --- qemu-5.2.0.orig/linux-user/mmap.c |
| 17 | +++ qemu-5.2.0/linux-user/mmap.c | 19 | +++ qemu-5.2.0/linux-user/mmap.c |
| 18 | @@ -727,7 +727,7 @@ abi_long target_mremap(abi_ulong old_add | 20 | @@ -722,12 +722,14 @@ abi_long target_mremap(abi_ulong old_add |
| 19 | !guest_range_valid(new_addr, new_size)) || | 21 | int prot; |
| 20 | ((flags & MREMAP_MAYMOVE) == 0 && | 22 | void *host_addr; |
| 21 | !guest_range_valid(old_addr, new_size))) { | 23 | |
| 24 | - if (!guest_range_valid(old_addr, old_size) || | ||
| 25 | - ((flags & MREMAP_FIXED) && | ||
| 26 | - !guest_range_valid(new_addr, new_size)) || | ||
| 27 | - ((flags & MREMAP_MAYMOVE) == 0 && | ||
| 28 | - !guest_range_valid(old_addr, new_size))) { | ||
| 22 | - errno = ENOMEM; | 29 | - errno = ENOMEM; |
| 30 | + if (!guest_range_valid(old_addr, old_size)) { | ||
| 23 | + errno = EFAULT; | 31 | + errno = EFAULT; |
| 32 | + return -1; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + if (((flags & MREMAP_FIXED) && !guest_range_valid(new_addr, new_size)) || | ||
| 36 | + ((flags & MREMAP_MAYMOVE) == 0 && !guest_range_valid(old_addr, new_size))) { | ||
| 37 | + errno = EINVAL; | ||
| 24 | return -1; | 38 | return -1; |
| 25 | } | 39 | } |
| 26 | 40 | ||
