From nobody Fri Oct 24 11:44:54 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 1519060423748193.2820144040178; Mon, 19 Feb 2018 09:13:43 -0800 (PST) Received: from localhost ([::1]:51448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enp0Y-0006j2-Qn for importer@patchew.org; Mon, 19 Feb 2018 12:13:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoxs-0004tz-0Z for qemu-devel@nongnu.org; Mon, 19 Feb 2018 12:10:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoxp-0005SE-30 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 12:10:55 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:40223) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enoxo-0005RE-Pu for qemu-devel@nongnu.org; Mon, 19 Feb 2018 12:10:53 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MRx1t-1fBr6R10cz-00SsBx; Mon, 19 Feb 2018 18:10:42 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 19 Feb 2018 18:10:32 +0100 Message-Id: <20180219171037.24539-4-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180219171037.24539-1-laurent@vivier.eu> References: <20180219171037.24539-1-laurent@vivier.eu> X-Provags-ID: V03:K0:RbFZ/u26OwhjWbSsHg8fzLSWVGBGrof0ft+shli2+0gfEPpfqpf uZKB2EWh0C17MquLUPvs03NtgtcCS2ME+Ml5WVOoZTv+ixG7nuKzLAeUhZd0jYmXfmfGp4J beWQ8nemgYVt+SQAH1rZPkp9JhIF7Q+qUcpIAHKNC17Lyeh1Nm6FVJDAtS6suOOVcIvWY/L JVI/3lHOgQ3JPSQTxHimg== X-UI-Out-Filterresults: notjunk:1;V01:K0:sLxT/33TodQ=:IzaEO7muUtG16jxr4G7Qsb 8CGXzr2xEA4vNsdi1/ijmq3dxwKrizToskIlELKBgvxxL5KN1C9atAiE9drdW2Na9hCG1Ua9P 1rlOZ3vjQfgxibUvPNmkThJGxjrKVFIza4neTxh4Hln/OGzb/XP6RJN2CJcVDNk9+uLOrUoGL PN0o+X2b5slBR+oOIOzsKmruvufZe5zXLcc19axarlKXyBLujasY2dUATwMW0UNbaI6Ek4w++ 3tEVclFnkf6IiL6WtPGvgYv4kbi6kRT0J2SzRlnSgCLTtMxRQbucieqLiFuE7wKOSWJ5yPkys NyjyU2c0FLtuvu4OHRDPFRtUOtSdHc7peBTiaclHNReTotR4aYdwvmGGQmdLqTk9WjZA0CntA 8sXIOwMNIA95/MuNIhx3DELxClb8VIztOX7au9OG1vths35N4hTVmt56dPKeKM5H1c5otEx0W aWkY8Uk3nx0r7TAUiqZl0/EG9COutqLXOqCdmaiwGfw0kLaBB4kvSLnT4mPJ95ojJahgNrW37 l3dv+WPNy6noDHtz0Xlmvaw0gtH9Zkz0kYVAJ4i1RcLM5M6YkDZFnTG9M0w6bZrgjUF2+/lyX iPbvDO3tXZiU8qpSRU+LDfV7NGyyX7QL8+Nsla4ld2MG3SsNRigwR/3VPDTKoKoCqGuEIKy3o FNx7P6bQfFIdx2CK3VO9AG3YUC8cQXJ4jRRfwCixG0vO35eAFc2pzblu7mqtNbLJ8XtO3/8Jv yMRMHPJ2RVvbbW8sDaTXkWdL+kpPJdeJCPtTog== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 3/8] 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