aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-06-06 19:58:02 +0100
committerRiku Voipio <riku.voipio@linaro.org>2016-06-08 10:13:45 +0300
commit918c03ed9ac583eb9d5c33345a814291e1dd2e87 (patch)
tree1154f0bb6289642ea1cd86f21c6f640623f7a90e /linux-user
parent977d8241c10de4160a9377efd496395c98b7dee9 (diff)
downloadqemu-918c03ed9ac583eb9d5c33345a814291e1dd2e87.zip
qemu-918c03ed9ac583eb9d5c33345a814291e1dd2e87.tar.gz
qemu-918c03ed9ac583eb9d5c33345a814291e1dd2e87.tar.bz2
linux-user: Use safe_syscall wrapper for readv and writev syscalls
Use the safe_syscall wrapper for readv and writev syscalls. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8f8d9db..e0c49cc 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -712,6 +712,8 @@ safe_syscall2(int, rt_sigsuspend, sigset_t *, newset, size_t, sigsetsize)
safe_syscall2(int, kill, pid_t, pid, int, sig)
safe_syscall2(int, tkill, int, tid, int, sig)
safe_syscall3(int, tgkill, int, tgid, int, pid, int, sig)
+safe_syscall3(ssize_t, readv, int, fd, const struct iovec *, iov, int, iovcnt)
+safe_syscall3(ssize_t, writev, int, fd, const struct iovec *, iov, int, iovcnt)
static inline int host_to_target_sock_type(int host_type)
{
@@ -8986,7 +8988,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
{
struct iovec *vec = lock_iovec(VERIFY_WRITE, arg2, arg3, 0);
if (vec != NULL) {
- ret = get_errno(readv(arg1, vec, arg3));
+ ret = get_errno(safe_readv(arg1, vec, arg3));
unlock_iovec(vec, arg2, arg3, 1);
} else {
ret = -host_to_target_errno(errno);
@@ -8997,7 +8999,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
{
struct iovec *vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
if (vec != NULL) {
- ret = get_errno(writev(arg1, vec, arg3));
+ ret = get_errno(safe_writev(arg1, vec, arg3));
unlock_iovec(vec, arg2, arg3, 0);
} else {
ret = -host_to_target_errno(errno);