From patchwork Mon Jun 6 18:58:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 69433 Delivered-To: patches@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1623682qgf; Mon, 6 Jun 2016 11:58:22 -0700 (PDT) X-Received: by 10.28.93.80 with SMTP id r77mr332859wmb.20.1465239502272; Mon, 06 Jun 2016 11:58:22 -0700 (PDT) Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id u187si10628256wmb.54.2016.06.06.11.58.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 11:58:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1b9zjB-0008P2-Rr; Mon, 06 Jun 2016 19:58:21 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Laurent Vivier Subject: [PATCH 02/18] linux-user: Use safe_syscall wrapper for connect syscall Date: Mon, 6 Jun 2016 19:58:03 +0100 Message-Id: <1465239499-5048-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465239499-5048-1-git-send-email-peter.maydell@linaro.org> References: <1465239499-5048-1-git-send-email-peter.maydell@linaro.org> Use the safe_syscall wrapper for the connect syscall. Signed-off-by: Peter Maydell --- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 28f7244..b649a8c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -701,6 +701,8 @@ 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) +safe_syscall3(int, connect, int, fd, const struct sockaddr *, addr, + socklen_t, addrlen) static inline int host_to_target_sock_type(int host_type) { @@ -2236,7 +2238,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr, if (ret) return ret; - return get_errno(connect(sockfd, addr, addrlen)); + return get_errno(safe_connect(sockfd, addr, addrlen)); } /* do_sendrecvmsg_locked() Must return target values and target errnos. */