From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754475AbcB1RgC (ORCPT ); Sun, 28 Feb 2016 12:36:02 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:32927 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753827AbcB1Rf7 (ORCPT ); Sun, 28 Feb 2016 12:35:59 -0500 Subject: Re: [PATCH for-4,5] mips/kvm: fix ioctl error handling To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org References: <1456673711-24132-1-git-send-email-mst@redhat.com> Cc: stable@vger.kernel.org, Paolo Bonzini , James Hogan , Ralf Baechle , kvm@vger.kernel.org, linux-mips@linux-mips.org From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: <56D32FFA.1000907@cogentembedded.com> Date: Sun, 28 Feb 2016 20:35:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1456673711-24132-1-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On 02/28/2016 06:35 PM, Michael S. Tsirkin wrote: > Calling return copy_to_user(...) or return copy_from_user in an ioctl Calling return? Perhaps "returning the result of"? > will not do the right thing if there's a pagefault: > copy_to_user/copy_from_user return the number of bytes not copied in > this case. > > Fix up kvm on mips to do > return copy_to_user(...)) ? -EFAULT : 0; > and > return copy_from_user(...)) ? -EFAULT : 0; > > everywhere. > > Cc: stable@vger.kernel.org > Signed-off-by: Michael S. Tsirkin [...] MBR, Sergei