linux/arch/s390/lib
Heiko Carstens f45655f6a6 s390/uaccess: fix strncpy_from_user/strnlen_user zero maxlen case
If the maximum length specified for the to be accessed string for
strncpy_from_user() and strnlen_user() is zero the following incorrect
values would be returned or incorrect memory accesses would happen:

strnlen_user_std() and strnlen_user_pt() incorrectly return "1"
strncpy_from_user_pt() would incorrectly access "dst[maxlen - 1]"
strncpy_from_user_mvcos() would incorrectly return "-EFAULT"

Fix all these oddities by adding early checks.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2013-02-28 09:37:08 +01:00
..
delay.c s390/time: rename tod clock access functions 2013-02-14 15:55:10 +01:00
div64.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
Makefile s390/string: provide asm lib functions for memcpy and memcmp 2012-09-26 15:44:50 +02:00
mem32.S s390/string: provide asm lib functions for memcpy and memcmp 2012-09-26 15:44:50 +02:00
mem64.S s390/string: provide asm lib functions for memcpy and memcmp 2012-09-26 15:44:50 +02:00
qrnnd.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
spinlock.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
string.c s390/string: provide asm lib functions for memcpy and memcmp 2012-09-26 15:44:50 +02:00
uaccess_mvcos.c s390/uaccess: fix strncpy_from_user/strnlen_user zero maxlen case 2013-02-28 09:37:08 +01:00
uaccess_pt.c s390/uaccess: fix strncpy_from_user/strnlen_user zero maxlen case 2013-02-28 09:37:08 +01:00
uaccess_std.c s390/uaccess: fix strncpy_from_user/strnlen_user zero maxlen case 2013-02-28 09:37:08 +01:00
uaccess.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
ucmpdi2.c [S390] add __ucmpdi2() helper function 2009-07-07 16:37:53 +02:00
usercopy.c [S390] uaccess: implement strict user copy checks 2010-02-26 22:37:29 +01:00