From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbcB2I2N (ORCPT ); Mon, 29 Feb 2016 03:28:13 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:33287 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbcB2I2J (ORCPT ); Mon, 29 Feb 2016 03:28:09 -0500 Date: Mon, 29 Feb 2016 09:29:14 +0100 From: Christoffer Dall To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Marc Zyngier , Paolo Bonzini , Russell King , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Dan Carpenter Subject: Re: [PATCH for-4.5] arm/kvm: fix ioctl error handling Message-ID: <20160229082914.GA3471@cbox> References: <1456673397-23625-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456673397-23625-1-git-send-email-mst@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 28, 2016 at 05:32:07PM +0200, Michael S. Tsirkin wrote: > Calling return copy_to_user(...) in an ioctl will not > do the right thing if there's a pagefault: > copy_to_user returns the number of bytes not copied > in this case. > > Fix up kvm to do > return copy_to_user(...)) ? -EFAULT : 0; > > everywhere. > > Cc: stable@vger.kernel.org > Signed-off-by: Michael S. Tsirkin Acked-by: Christoffer Dall