summaryrefslogtreecommitdiff
path: root/mm/usercopy.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-06-16 16:36:17 +0200
committerKees Cook <keescook@chromium.org>2022-07-01 17:03:38 -0700
commit170b2c350cfcb6f74074e44dd9f916787546db0d (patch)
tree16d6965263382368d7e3f3bde14b353f9fd39c92 /mm/usercopy.c
parenta111daf0c53ae91e71fd2bfe7497862d14132e3e (diff)
usercopy: use unsigned long instead of uintptr_t
A recent commit factored out a series of annoying (unsigned long) casts into a single variable declaration, but made the pointer type a `uintptr_t` rather than the usual `unsigned long`. This patch changes it to be the integer type more typically used by the kernel to represent addresses. Fixes: 35fb9ae4aa2e ("usercopy: Cast pointer to an integer once") Cc: Matthew Wilcox <willy@infradead.org> Cc: Uladzislau Rezki <urezki@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Joe Perches <joe@perches.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20220616143617.449094-1-Jason@zx2c4.com
Diffstat (limited to 'mm/usercopy.c')
-rw-r--r--mm/usercopy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 4e1da708699b..c1ee15a98633 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -161,7 +161,7 @@ static inline void check_bogus_address(const unsigned long ptr, unsigned long n,
static inline void check_heap_object(const void *ptr, unsigned long n,
bool to_user)
{
- uintptr_t addr = (uintptr_t)ptr;
+ unsigned long addr = (unsigned long)ptr;
unsigned long offset;
struct folio *folio;