fs-verity: Avoid u64_to_user_ptr() clang warning
Clang emits -Wdefault-const-init-var-unsafe when using u64_to_user_ptr() due to the typecheck() macro creating an uninitialized dummy variable. Replace u64_to_user_ptr() with an explicit cast through uintptr_t to avoid the warning while keeping the same behavior. Signed-off-by: Sorayukii <sorayukii69@gmail.com>
This commit is contained in:
parent
b8f5c98e8d
commit
28e63022dc
1 changed files with 6 additions and 4 deletions
|
|
@ -210,8 +210,9 @@ static int enable_verity(struct file *filp,
|
|||
|
||||
/* Get the salt if the user provided one */
|
||||
if (arg->salt_size &&
|
||||
copy_from_user(desc->salt, u64_to_user_ptr(arg->salt_ptr),
|
||||
arg->salt_size)) {
|
||||
copy_from_user(desc->salt,
|
||||
(void __user *)(uintptr_t)arg->salt_ptr,
|
||||
arg->salt_size)) {
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -219,8 +220,9 @@ static int enable_verity(struct file *filp,
|
|||
|
||||
/* Get the signature if the user provided one */
|
||||
if (arg->sig_size &&
|
||||
copy_from_user(desc->signature, u64_to_user_ptr(arg->sig_ptr),
|
||||
arg->sig_size)) {
|
||||
copy_from_user(desc->signature,
|
||||
(void __user *)(uintptr_t)arg->sig_ptr,
|
||||
arg->sig_size)) {
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue