Skip to content

Commit da3a3da

Browse files
committed
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/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 439bea1 commit da3a3da

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/verity/enable.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ static int enable_verity(struct file *filp,
216216

217217
/* Get the salt if the user provided one */
218218
if (arg->salt_size &&
219-
copy_from_user(desc->salt,
220-
(const u8 __user *)(uintptr_t)arg->salt_ptr,
219+
copy_from_user(desc->salt, u64_to_user_ptr(arg->salt_ptr),
221220
arg->salt_size)) {
222221
err = -EFAULT;
223222
goto out;
@@ -226,8 +225,7 @@ static int enable_verity(struct file *filp,
226225

227226
/* Get the signature if the user provided one */
228227
if (arg->sig_size &&
229-
copy_from_user(desc->signature,
230-
(const u8 __user *)(uintptr_t)arg->sig_ptr,
228+
copy_from_user(desc->signature, u64_to_user_ptr(arg->sig_ptr),
231229
arg->sig_size)) {
232230
err = -EFAULT;
233231
goto out;

0 commit comments

Comments
 (0)