From: Heiko Carstens Date: Thu, 21 Feb 2013 12:30:42 +0000 (+0100) Subject: s390/uaccess: fix strncpy_from_user/strnlen_user zero maxlen case X-Git-Tag: v3.9-rc1~5^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f45655f6a65538237359abce55edab9cfcc6d82f;p=pandora-kernel.git 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 Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- Reading git-diff-tree failed