From patchwork Tue Jun 21 17:51:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9191175 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 7C5106075E for ; Tue, 21 Jun 2016 17:52:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 722AE28307 for ; Tue, 21 Jun 2016 17:52:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66E9928319; Tue, 21 Jun 2016 17:52:20 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 0D47128307 for ; Tue, 21 Jun 2016 17:52:20 +0000 (UTC) Received: from localhost ([::1]:53437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFPqV-0003Y8-5C for patchwork-qemu-devel@patchwork.kernel.org; Tue, 21 Jun 2016 13:52:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFPpx-0003Sp-12 for qemu-devel@nongnu.org; Tue, 21 Jun 2016 13:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFPpq-000337-Qd for qemu-devel@nongnu.org; Tue, 21 Jun 2016 13:51:45 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:51181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFPpq-00032u-Fm for qemu-devel@nongnu.org; Tue, 21 Jun 2016 13:51:38 -0400 Received: from Quad.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LdmwF-1bgBsU1Ubz-00iyRF; Tue, 21 Jun 2016 19:51:25 +0200 From: Laurent Vivier To: Riku Voipio Date: Tue, 21 Jun 2016 19:51:13 +0200 Message-Id: <1466531475-13389-2-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466531475-13389-1-git-send-email-laurent@vivier.eu> References: <1466531475-13389-1-git-send-email-laurent@vivier.eu> X-Provags-ID: V03:K0:/1GLzeaudNi2ivVxXIVG0c7YSzmKTwFZ+jBv3Q9eKpeD2RBB92s GRuGwA5kOstbHoLle//CYszfFDkZWX0WPmRWE12Ed/OPc+feFPfCx1zGlNR8TdeVK7hKFOq LmpCgtCcIq2GQ0B+O/mWTIDVkTq/cdKy4EzbNhDZGgjXB3aUcV7R2ck55Sy2m2pRZLXiL+p PZq7XG55PlZRPH5wBwUWg== X-UI-Out-Filterresults: notjunk:1; V01:K0:Giq8Hu6mcLE=:oZl6AoLezw84VtQJwEBvQW JL1DmcDFfhJGjlKWioV7HivZ30Tqc4z6wNHAJWiA9DQKxkFjzABNYxrbgZ2oROGvvcLGV4ZaX 8CIcQpNeEV+UFz5YwfJB607IyWdbxgOHlT5xDpyCjTzDqTkFJWkugmY0MbCIyAb+9UNXa+SnY wNlXLRggW1lZoQCc2bxo5+W9Y3oHHHzDX34skBuKC5m9Ge2ed0qDTarD2EXqH2Uy6bmUaeJwU qAnhggfTiFv+qH7mrlbrEbAnERRktbBLLZTf0FTntMy3YGYFBx8vifaRl3/tc2KpWGBuKVCha LMfffcMuI8Tk5OGwmRC52McmDj4sI9rLO9PixBsCZC9UJDTNgP+fB4TOSlek5BtrwLkT4PCUu xqNXS6UR0NT79UFA3tPdCN7SFf4O6yIo/3pSMV6lfJ7KKFJasifpXn5+uTtk+0StWN2ZEHLn9 vheSvySfmucuJaevEGNSRLG9g58qE6ui918XevZb5f+xJZs82pwoyDUmvhTogdKbj7WU2gwfe pl3pdpcVrbbwD9ffrXUfJWpTVIFUctIDDuCHqk4F65GUVnfOEqTSxi/paQ1frxjiNQS4ihCky 16/U05nDWIw+PMikYhKniGPjxT1urGyaEbnTo1VvDRlhARjI9ShXMD/MnJIZdxqAuEnxiQFSy 5GgjRwd1l5Ee6aDEqaWjM8sbN5Hucshzh2bbrsPOgT7h5isb2+okt1TsXor5n/2DE7QU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PATCH 1/3] linux-user: fd_trans_*_data() returns the length 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: qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP fd_trans_target_to_host_data() and fd_trans_host_to_target_data() must return the length of processed data. Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0082762..9a5cd26 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2821,12 +2821,26 @@ static TargetFdTrans target_packet_trans = { #ifdef CONFIG_RTNETLINK static abi_long netlink_route_target_to_host(void *buf, size_t len) { - return target_to_host_nlmsg_route(buf, len); + abi_long ret; + + ret = target_to_host_nlmsg_route(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static abi_long netlink_route_host_to_target(void *buf, size_t len) { - return host_to_target_nlmsg_route(buf, len); + abi_long ret; + + ret = host_to_target_nlmsg_route(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static TargetFdTrans target_netlink_route_trans = { @@ -2837,12 +2851,26 @@ static TargetFdTrans target_netlink_route_trans = { static abi_long netlink_audit_target_to_host(void *buf, size_t len) { - return target_to_host_nlmsg_audit(buf, len); + abi_long ret; + + ret = target_to_host_nlmsg_audit(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static abi_long netlink_audit_host_to_target(void *buf, size_t len) { - return host_to_target_nlmsg_audit(buf, len); + abi_long ret; + + ret = host_to_target_nlmsg_audit(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static TargetFdTrans target_netlink_audit_trans = {