]> git.baikalelectronics.ru Git - kernel.git/commit
x86: copy_from_user() should not return -EFAULT
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 5 Jan 2010 13:19:11 +0000 (14:19 +0100)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 5 Jan 2010 21:45:06 +0000 (13:45 -0800)
commit837b196685751daebbea5e92c535ad9e6aa90204
treeb0a306edba73fe23fde15568ff04dbb00e5536cc
parentfc12ac90319152c7b25d9eeec035b1e7491800c4
x86: copy_from_user() should not return -EFAULT

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.

[ hpa: code is not in .32 so not needed for -stable ]

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
LKML-Reference: <20100105131911.GC5480@osiris.boeblingen.de.ibm.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/include/asm/uaccess_32.h
arch/x86/include/asm/uaccess_64.h