Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755193Ab0AER47 (ORCPT ); Tue, 5 Jan 2010 12:56:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753907Ab0AER46 (ORCPT ); Tue, 5 Jan 2010 12:56:58 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:52314 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754871Ab0AER46 (ORCPT ); Tue, 5 Jan 2010 12:56:58 -0500 From: Arnd Bergmann To: Heiko Carstens Subject: Re: [PATCH] sparc: copy_from_user() should not return -EFAULT Date: Tue, 5 Jan 2010 18:55:58 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31-14-generic; KDE/4.3.2; x86_64; ; ) Cc: Arjan van de Ven , Ingo Molnar , David Miller , Andrew Morton , linux-kernel@vger.kernel.org, Chris Zankel References: <20100104154345.GA5671@osiris.boeblingen.de.ibm.com> <20100105053117.6a7c3377@infradead.org> <20100105152215.GD5480@osiris.boeblingen.de.ibm.com> In-Reply-To: <20100105152215.GD5480@osiris.boeblingen.de.ibm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201001051855.59100.arnd@arndb.de> X-Provags-ID: V01U2FsdGVkX180tgqEEN+mo050VKs7nn4XCY0av0ECrarYD1u rSeJBq3HOgtUt3XlOmRMrWU6MBDaqoRzTOKJswQ5XiXu23nzss bEpCgvGDHjDklXNLPCISQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 906 Lines: 23 On Tuesday 05 January 2010, Heiko Carstens wrote: > Subject: [PATCH] sparc: copy_from_user() should not return -EFAULT > > From: Heiko Carstens > > Callers of copy_from_user() expect it to return the number of bytes > it could not copy. In no case it is supposed to return -EFAULT. > > In case of a detected buffer overflow just return the requested > length. In addition one could think of a memset that would clear > the size of the target object. > > Signed-off-by: Heiko Carstens The xtensa clear_user function seems to have a similar issue, it should return size on failure, not -EFAULT. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/