summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-12-31 18:54:08 +0100
committerEric Biggers <ebiggers@google.com>2020-01-14 22:28:28 +0100
commitda3a3da4e6c68459618a1043dcb12b450312a4e2 (patch)
treeac7bd7709b0da2d6b743456fd0f3e2c8d25313ee
parentfs-verity: use mempool for hash requests (diff)
downloadlinux-da3a3da4e6c68459618a1043dcb12b450312a4e2.tar.xz
linux-da3a3da4e6c68459618a1043dcb12b450312a4e2.zip
fs-verity: use u64_to_user_ptr()
<linux/kernel.h> already provides a macro u64_to_user_ptr(). Use it instead of open-coding the two casts. No change in behavior. Link: https://lore.kernel.org/r/20191231175408.20524-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
-rw-r--r--fs/verity/enable.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/verity/enable.c b/fs/verity/enable.c
index f8535732905f..d98bea308fd7 100644
--- a/fs/verity/enable.c
+++ b/fs/verity/enable.c
@@ -216,8 +216,7 @@ static int enable_verity(struct file *filp,
/* Get the salt if the user provided one */
if (arg->salt_size &&
- copy_from_user(desc->salt,
- (const u8 __user *)(uintptr_t)arg->salt_ptr,
+ copy_from_user(desc->salt, u64_to_user_ptr(arg->salt_ptr),
arg->salt_size)) {
err = -EFAULT;
goto out;
@@ -226,8 +225,7 @@ static int enable_verity(struct file *filp,
/* Get the signature if the user provided one */
if (arg->sig_size &&
- copy_from_user(desc->signature,
- (const u8 __user *)(uintptr_t)arg->sig_ptr,
+ copy_from_user(desc->signature, u64_to_user_ptr(arg->sig_ptr),
arg->sig_size)) {
err = -EFAULT;
goto out;