aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-07-31 11:27:43 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-07-31 11:27:43 +0100
commit25dd0e77898c3e10796d4cbeb35e8af5ba6ce975 (patch)
treec92fef1efcce9d5b05927b6df09e28ac45d5ae2f /linux-user
parent0c26c080ee592ea47597d3ab8fd712d7d2c4ba0f (diff)
parent25e11d8774630600ef4c5e9906419a77163a28a1 (diff)
downloadqemu-25dd0e77898c3e10796d4cbeb35e8af5ba6ce975.zip
qemu-25dd0e77898c3e10796d4cbeb35e8af5ba6ce975.tar.gz
qemu-25dd0e77898c3e10796d4cbeb35e8af5ba6ce975.tar.bz2
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
trivial patches for 2017-07-31 # gpg: Signature made Mon 31 Jul 2017 11:18:57 BST # gpg: using RSA key 0x701B4F6B1A693E59 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59 * remotes/mjt/tags/trivial-patches-fetch: (25 commits) docs: fix broken paths to docs/specs/ivshmem-spec.txt docs: fix broken paths to docs/config/ich9-ehci-uhci.cfg docs: fix broken paths to docs/devel/tracing.txt docs: fix broken paths to docs/devel/atomics.txt docs: fix broken paths to docs/devel/qapi-code-gen.txt docs: fix broken paths to docs/interop/qcow2.txt docs: fix broken paths to docs/interop dir thunk: assert nb_fields is valid syscall: check inotify() and eventfd() return value syscall: fix use of uninitialized values syscall: fix dereference of undefined pointer linux-user/sh4: fix incorrect memory write m68k/translate: fix incorrect copy/paste net/eth: fix incorrect check of iov_to_buf() return value ui/vnc: fix leak of SocketAddress ** qcow2: fix null pointer dereference ivshmem: fix incorrect error handling in ivshmem_recv_msg() loader: check get_image_size() return value tests: add missing dependency to build QTEST_QEMU_BINARY qemu-system-tricore: segfault when entering "x 0" on the monitor ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/elfload.c2
-rw-r--r--linux-user/syscall.c18
-rw-r--r--linux-user/trace-events2
3 files changed, 16 insertions, 6 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 2a902f7..7906288 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1099,7 +1099,7 @@ static inline void elf_core_copy_regs(target_elf_gregset_t *regs,
int i;
for (i = 0; i < 16; i++) {
- (*regs[i]) = tswapreg(env->gregs[i]);
+ (*regs)[i] = tswapreg(env->gregs[i]);
}
(*regs)[TARGET_REG_PC] = tswapreg(env->pc);
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 003943b..dfc1301 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1622,6 +1622,7 @@ static inline abi_long host_to_target_sockaddr(abi_ulong target_addr,
if (len == 0) {
return 0;
}
+ assert(addr);
target_saddr = lock_user(VERIFY_WRITE, target_addr, len, 0);
if (!target_saddr)
@@ -5573,6 +5574,7 @@ static abi_long do_ioctl_rt(const IOCTLEntry *ie, uint8_t *buf_temp,
field_types, THUNK_HOST);
}
unlock_user(argptr, arg, 0);
+ assert(host_rt_dev_ptr);
ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
if (*host_rt_dev_ptr != 0) {
@@ -11740,7 +11742,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
case TARGET_NR_inotify_init:
ret = get_errno(sys_inotify_init());
- fd_trans_register(ret, &target_inotify_trans);
+ if (ret >= 0) {
+ fd_trans_register(ret, &target_inotify_trans);
+ }
break;
#endif
#ifdef CONFIG_INOTIFY1
@@ -11748,7 +11752,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_inotify_init1:
ret = get_errno(sys_inotify_init1(target_to_host_bitmask(arg1,
fcntl_flags_tbl)));
- fd_trans_register(ret, &target_inotify_trans);
+ if (ret >= 0) {
+ fd_trans_register(ret, &target_inotify_trans);
+ }
break;
#endif
#endif
@@ -11914,7 +11920,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#if defined(TARGET_NR_eventfd)
case TARGET_NR_eventfd:
ret = get_errno(eventfd(arg1, 0));
- fd_trans_register(ret, &target_eventfd_trans);
+ if (ret >= 0) {
+ fd_trans_register(ret, &target_eventfd_trans);
+ }
break;
#endif
#if defined(TARGET_NR_eventfd2)
@@ -11928,7 +11936,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
host_flags |= O_CLOEXEC;
}
ret = get_errno(eventfd(arg1, host_flags));
- fd_trans_register(ret, &target_eventfd_trans);
+ if (ret >= 0) {
+ fd_trans_register(ret, &target_eventfd_trans);
+ }
break;
}
#endif
diff --git a/linux-user/trace-events b/linux-user/trace-events
index fc71f91..80ad957 100644
--- a/linux-user/trace-events
+++ b/linux-user/trace-events
@@ -1,4 +1,4 @@
-# See docs/tracing.txt for syntax documentation.
+# See docs/devel/tracing.txt for syntax documentation.
# linux-user/signal.c
user_setup_frame(void *env, uint64_t frame_addr) "env=%p frame_addr=%"PRIx64