summary refs log tree commit diff stats
path: root/linux-user/mmap.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-12-02 15:41:38 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-12-02 15:41:38 +0000
commit30a9fd5d13b0a4290382adc4c1bf619677066b89 (patch)
tree7327dbaa1da19f0e397dfef405a45755ff61a92c /linux-user/mmap.c
parent9d7b969ea6d9663a94760c6c131481b366f4d38a (diff)
parent0c2d70c448b7853a91cfa63659aa3cc6630fb9be (diff)
downloadfocaccia-qemu-30a9fd5d13b0a4290382adc4c1bf619677066b89.tar.gz
focaccia-qemu-30a9fd5d13b0a4290382adc4c1bf619677066b89.zip
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* exec.c use after free
* Xen 32-on-64 breakage
* missing EINTR
* naughty warning under qtest

# gpg: Signature made Wed 02 Dec 2015 12:13:55 GMT using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"

* remotes/bonzini/tags/for-upstream:
  translate-all: ensure host page mask is always extended with 1's
  main-loop: suppress warnings under qtest
  qemu-char: retry g_poll on EINTR
  exec: Stop using memory after free

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user/mmap.c')
-rw-r--r--linux-user/mmap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 5606bcd164..7b459d5100 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -444,9 +444,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
            /* If so, truncate the file map at eof aligned with 
               the hosts real pagesize. Additional anonymous maps
               will be created beyond EOF.  */
-           len = (sb.st_size - offset);
-           len += qemu_real_host_page_size - 1;
-           len &= ~(qemu_real_host_page_size - 1);
+           len = REAL_HOST_PAGE_ALIGN(sb.st_size - offset);
        }
     }