diff options
| author | Peter Maydell | 2016-07-18 16:36:00 +0200 |
|---|---|---|
| committer | Riku Voipio | 2016-10-21 14:19:41 +0200 |
| commit | 04c95f4da7f657a0bef17d115d0a5ca2ac0e2d22 (patch) | |
| tree | 736a7cadc4ba8bec87fa81acc274ceeb152df7c4 /linux-user/mmap.c | |
| parent | linux-user: add RTA_PRIORITY in netlink (diff) | |
| download | qemu-04c95f4da7f657a0bef17d115d0a5ca2ac0e2d22.tar.gz qemu-04c95f4da7f657a0bef17d115d0a5ca2ac0e2d22.tar.xz qemu-04c95f4da7f657a0bef17d115d0a5ca2ac0e2d22.zip | |
linux-user: Don't use alloca() for epoll_wait's epoll event array
The epoll event array which epoll_wait() allocates has a size
determined by the guest which could potentially be quite large.
Use g_try_new() rather than alloca() so that we can fail more
cleanly if the guest hands us an oversize value. (ENOMEM is
not a documented return value for epoll_wait() but in practice
some kernel configurations can return it -- see for instance
sys_oabi_epoll_wait() on ARM.)
This rearrangement includes fixing a bug where we were
incorrectly passing a negative length to unlock_user() in
the error-exit codepath.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/mmap.c')
0 files changed, 0 insertions, 0 deletions
