From patchwork Wed Jun 8 13:30:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 69660 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2520366qgf; Wed, 8 Jun 2016 07:16:40 -0700 (PDT) X-Received: by 10.55.164.20 with SMTP id n20mr4794677qke.73.1465395400947; Wed, 08 Jun 2016 07:16:40 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t14si746473qke.280.2016.06.08.07.16.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Jun 2016 07:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAeHg-0004BW-DC for patch@linaro.org; Wed, 08 Jun 2016 10:16:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZd-0004VX-NC for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZX-0005pT-BC for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:08 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:33722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZX-0005pL-3I for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:03 -0400 Received: by mail-lf0-x22f.google.com with SMTP id s64so5906737lfe.0 for ; Wed, 08 Jun 2016 06:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x03utXWBu9+P606W+Kx6ElsQRMgiEU9DuRVi1L/zLaw=; b=MWk7xHeoYdf0lPr01ZsrBKPlkL0zPOyYsbxlYiXqKyVd2mXS24DjSadtM4LZY0W1Xh R2EARotgS/aDkAh9VWrcsMvDQ1FH69RSTOQzjr4uAyB9XfhRzccmbeIbSh7CJV0hVpUa fW7oj+SrzpvNa4H9Evh3zu+bzF5h4pF8+MmtA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x03utXWBu9+P606W+Kx6ElsQRMgiEU9DuRVi1L/zLaw=; b=iXkjomPSTeCnAPj5MmNQFz/IbqwxlIslBF5wSLeIp2cKCJEpRB8H13Q3jsauopZWNS fqSJD5yi+DboeDuo9o30GmyNS3VZlJLiQ1Zr+NgW4snYWNa3sT9HXuirleB2fABqTybm 63vk6X+gdu9j8ENe4jCPpvAq5w7iahUPmVMOXZ6GKdK+6fpg4dg+dYPdHROEqSGGXm1n 9zbSat3OyFgwf+KIQWsBbaUfynrI4npMSYCgEa23tSvQPyGoUjhKF9IUvJFQAeoJvEJX XNL1ziXRRUpzQygdxMpXb7C1AQcPv75b7LEWX2tCmkCOXswpJeT3yhz44yD4/SIv3DZk EZvg== X-Gm-Message-State: ALyK8tJygMcjNIjQI9oOPd8FpAvtJwqf0Ni29/vsjU+mdIksdvLWUB/hcUhYoyhcWyxeGeU0 X-Received: by 10.25.80.134 with SMTP id e128mr5162552lfb.115.1465392662426; Wed, 08 Jun 2016 06:31:02 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 2sm139854lja.37.2016.06.08.06.31.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:31:01 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 16:30:10 +0300 Message-Id: <2a3c7619288af9cfcc09a233dce911bf80849dfb.1465392531.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22f Subject: [Qemu-devel] [PULL 29/44] linux-user: Use safe_syscall wrapper for connect syscall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Use the safe_syscall wrapper for the connect syscall. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e0c49cc..b363944 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -714,6 +714,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) { @@ -2859,7 +2861,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. */