From: Vineet Gupta Date: Thu, 26 Sep 2013 13:20:40 +0000 (+0530) Subject: ARC: Fix 32-bit wrap around in access_ok() X-Git-Tag: v3.12-rc4~41^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0752adfda15f0eca9859a76da3db1800e129ad43;p=pandora-kernel.git ARC: Fix 32-bit wrap around in access_ok() Anton reported | LTP tests syscalls/process_vm_readv01 and process_vm_writev01 fail | similarly in one testcase test_iov_invalid -> lvec->iov_base. | Testcase expects errno EFAULT and return code -1, | but it gets return code 1 and ERRNO is 0 what means success. Essentially test case was passing a pointer of -1 which access_ok() was not catching. It was doing [@addr + @sz <= TASK_SIZE] which would pass for @addr == -1 Fixed that by rewriting as [@addr <= TASK_SIZE - @sz] Reported-by: Anton Kolesov Signed-off-by: Vineet Gupta --- Reading git-diff-tree failed