diff options
| author | Peter Maydell | 2013-02-08 08:58:41 +0100 |
|---|---|---|
| committer | Riku Voipio | 2013-03-11 13:34:05 +0100 |
| commit | dfae8e00f8ddeedcda24bd28f71d4fd2a9f988b8 (patch) | |
| tree | 0b20f25353cc5cfa637fdfd7c6eb66203800a4c3 /linux-user | |
| parent | linux-user: Fix layout of usage table to account for option text (diff) | |
| download | qemu-dfae8e00f8ddeedcda24bd28f71d4fd2a9f988b8.tar.gz qemu-dfae8e00f8ddeedcda24bd28f71d4fd2a9f988b8.tar.xz qemu-dfae8e00f8ddeedcda24bd28f71d4fd2a9f988b8.zip | |
linux-user: make bogus negative iovec lengths fail EINVAL
If the guest passes us a bogus negative length for an iovec, fail
EINVAL rather than proceeding blindly forward. This fixes some of
the error cases tests for readv and writev in the LTP.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
| -rw-r--r-- | linux-user/syscall.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1729446840..bab9ab58a0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1776,7 +1776,7 @@ static struct iovec *lock_iovec(int type, abi_ulong target_addr, errno = 0; return NULL; } - if (count > IOV_MAX) { + if (count < 0 || count > IOV_MAX) { errno = EINVAL; return NULL; } |
