mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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>
This commit is contained in:
@@ -216,8 +216,7 @@ static int enable_verity(struct file *filp,
|
|||||||
|
|
||||||
/* Get the salt if the user provided one */
|
/* Get the salt if the user provided one */
|
||||||
if (arg->salt_size &&
|
if (arg->salt_size &&
|
||||||
copy_from_user(desc->salt,
|
copy_from_user(desc->salt, u64_to_user_ptr(arg->salt_ptr),
|
||||||
(const u8 __user *)(uintptr_t)arg->salt_ptr,
|
|
||||||
arg->salt_size)) {
|
arg->salt_size)) {
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
@@ -226,8 +225,7 @@ static int enable_verity(struct file *filp,
|
|||||||
|
|
||||||
/* Get the signature if the user provided one */
|
/* Get the signature if the user provided one */
|
||||||
if (arg->sig_size &&
|
if (arg->sig_size &&
|
||||||
copy_from_user(desc->signature,
|
copy_from_user(desc->signature, u64_to_user_ptr(arg->sig_ptr),
|
||||||
(const u8 __user *)(uintptr_t)arg->sig_ptr,
|
|
||||||
arg->sig_size)) {
|
arg->sig_size)) {
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
|
Reference in New Issue
Block a user