summaryrefslogtreecommitdiff
path: root/lib/test_lockup.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2022-02-14 22:22:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 15:40:35 +0300
commit40a5c93a747389de01ee7195c414cb424710ea6f (patch)
tree5b581402850cd687d2c2c397485cf7511aae9c71 /lib/test_lockup.c
parenta49b687a75d2d42301ec9a5fda356750827900e7 (diff)
downloadlinux-40a5c93a747389de01ee7195c414cb424710ea6f.tar.xz
uaccess: fix type mismatch warnings from access_ok()
[ Upstream commit 23fc539e81295b14b50c6ccc5baeb4f3d59d822d ] On some architectures, access_ok() does not do any argument type checking, so replacing the definition with a generic one causes a few warnings for harmless issues that were never caught before. Fix the ones that I found either through my own test builds or that were reported by the 0-day bot. Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Dinh Nguyen <dinguyen@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/test_lockup.c')
-rw-r--r--lib/test_lockup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/test_lockup.c b/lib/test_lockup.c
index f1a020bcc763..07f476317187 100644
--- a/lib/test_lockup.c
+++ b/lib/test_lockup.c
@@ -417,8 +417,8 @@ static bool test_kernel_ptr(unsigned long addr, int size)
return false;
/* should be at least readable kernel address */
- if (access_ok(ptr, 1) ||
- access_ok(ptr + size - 1, 1) ||
+ if (access_ok((void __user *)ptr, 1) ||
+ access_ok((void __user *)ptr + size - 1, 1) ||
get_kernel_nofault(buf, ptr) ||
get_kernel_nofault(buf, ptr + size - 1)) {
pr_err("invalid kernel ptr: %#lx\n", addr);