From nobody Fri Oct 24 12:48:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519118334763541.2572490275788; Tue, 20 Feb 2018 01:18:54 -0800 (PST) Received: from localhost ([::1]:54260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo44b-0004nQ-Tw for importer@patchew.org; Tue, 20 Feb 2018 04:18:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo42k-0003rp-4s for qemu-devel@nongnu.org; Tue, 20 Feb 2018 04:16:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo42i-0005iT-1J for qemu-devel@nongnu.org; Tue, 20 Feb 2018 04:16:58 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:56347) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eo42h-0005hC-Nj for qemu-devel@nongnu.org; Tue, 20 Feb 2018 04:16:55 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0Lx6wD-1egyQx2VIn-016jH3; Tue, 20 Feb 2018 10:16:46 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 10:16:39 +0100 Message-Id: <20180220091640.10875-4-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180220091640.10875-1-laurent@vivier.eu> References: <20180220091640.10875-1-laurent@vivier.eu> X-Provags-ID: V03:K0:QbmySQqJs4w4N14RqnhxCWEkQdQNq1+GquOnOgNuojk/xmptiy7 9XcflM8Y7a3VH27r0WE9OEEXtycAERcX1H5YgbV8Hh7vGP6ld3RN0YSryGqKxJEdWudwFBc ByCvAqgLM5ham4KrMcrftrg7YOvfjN/6kD9QGKVZYoYJHqE5WBJ2kBeTkhXJEtnM6QRSlgU hrgSijn4LDzz37c+VmqlQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:PyY1w0Jc7zE=:9UhD0vmYTr9Jw821w800D9 woIXTaIxKk37RI72PVWEqluE8dt/TsWen8T/Gtwlba/RphZ97khHe21MYSnSxKg7tFXdmQCg/ CJ6UN0ksmgog7Q8laJClydVN0Mwu1976lQiv9mid3pR//NLO6M6sRVs3dZo6hDYezdOB43o4L w7aqGZEjJUa7wrSSecpEe9/OlYlRV89Vzoaf+yxoXyPyxza8XTjkvWxEgX1tEDBqTiIIHCKFO WWgO4pPHEZaEANBplq4sZuIY0j625E69tiLhJwu/YcHN23JTTqnXYzpJiZUUJ77LwE76PMgh8 MRroRL/1mumphx2AQcDoQRvyluqxXOWzSaBwELoyNEQO6Pf1SRGwtst9k7xpKe3A+YOHSJTB1 4ykpeo4QJC/XcaEfqQcUC5kb6ahuGQsvW5o3a25yclHPC+JjZC4w8Kw4bKHng/0qVS4Y1LEKX 1z1G2R5+hdRQMZYqg5ZIIVSseNwybrtEcTb8IgjEolCzRvP2dV0U+Z/AoHtZw8b8mJ6ab3Pvi fdN/TmrLyP1aGzPhhutu8Esmr7BQq2ZMJDrR9F9LOv1EXriQwWI4Q+OCENr/VbX1t1XNmuWBm lvomi6vBqWJ0aK9P+wAa2PSTXsDoaIK2G828M5MuIJyNz7GHXKIGeYt5qnH1bRLfCZ3quBci7 PNo77VctfU/L4P4LE5zB9ys6vn8a5izYqFwjPNCxFDB2tLKAQMGF0kacbjwSNGpBDd8CztZm3 mCjeCtSPJ1xJ1AFwR3QgtSJ4el0wclBfvknWRg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL 3/4] linux-user: Fix sched_getaffinity mask size 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: Samuel Thibault , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Samuel Thibault We properly computed the capped mask size to be put to the application buffer, but didn't actually used it. Also, we need to return the capped mask size instead of 0 on success. Signed-off-by: Samuel Thibault Reviewed-by: Laurent Vivier Message-Id: <20180211174704.27441-1-samuel.thibault@ens-lyon.org> Signed-off-by: Laurent Vivier --- 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 effc3a0881..e24f43c4a2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10502,7 +10502,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, ret =3D arg2; } =20 - ret =3D host_to_target_cpu_mask(mask, mask_size, arg3, arg= 2); + if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) { + goto efault; + } } } break; --=20 2.14.3