From patchwork Mon May 2 09:19:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 93617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9FABF1007D1 for ; Mon, 2 May 2011 19:20:43 +1000 (EST) Received: from localhost ([::1]:37564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGpJ2-0003aU-RM for incoming@patchwork.ozlabs.org; Mon, 02 May 2011 05:20:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGpHq-0001XT-Ix for qemu-devel@nongnu.org; Mon, 02 May 2011 05:19:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGpHp-0006f5-If for qemu-devel@nongnu.org; Mon, 02 May 2011 05:19:26 -0400 Received: from afflict.kos.to ([92.243.29.197]:56824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGpHp-0006e8-E7 for qemu-devel@nongnu.org; Mon, 02 May 2011 05:19:25 -0400 Received: from kos.to (a88-115-163-181.elisa-laajakaista.fi [88.115.163.181]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 0E5BB2668E; Mon, 2 May 2011 09:19:16 +0000 (UTC) Received: by kos.to (sSMTP sendmail emulation); Mon, 02 May 2011 12:19:16 +0300 From: riku.voipio@iki.fi To: qemu-devel@nongnu.org Date: Mon, 2 May 2011 12:19:09 +0300 Message-Id: <1304327950-21422-3-git-send-email-riku.voipio@iki.fi> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1304327950-21422-1-git-send-email-riku.voipio@iki.fi> References: <1304327950-21422-1-git-send-email-riku.voipio@iki.fi> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 92.243.29.197 Cc: Mike McCormack , Riku Voipio Subject: [Qemu-devel] [PATCH 2/3] Fix buffer overrun in sched_getaffinity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Mike McCormack Zeroing of the cpu array should start from &cpus[kernel_ret] not &cpus[num_zeros_to_fill]. This fixes a crash in EFL's edje_cc running under qemu-arm. Signed-off-by: Mike McCormack Reviewed-by: Stefan Hajnoczi Acked-by: Mike Frysinger Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e969d1b..5b7b8e2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6505,7 +6505,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, unsigned long zero = arg2 - ret; p = alloca(zero); memset(p, 0, zero); - if (copy_to_user(arg3 + zero, p, zero)) { + if (copy_to_user(arg3 + ret, p, zero)) { goto efault; } arg2 = ret;