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: 9164799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 85226604DB for ; Wed, 8 Jun 2016 14:14:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C0AB265B9 for ; Wed, 8 Jun 2016 14:14:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70E0627BE5; Wed, 8 Jun 2016 14:14:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FSL_HELO_HOME, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1176265B9 for ; Wed, 8 Jun 2016 14:14:46 +0000 (UTC) Received: from localhost ([::1]:57253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAeFq-0002vZ-1W for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Jun 2016 10:14:46 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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. */