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:
Sorayukii 2026-03-16 12:32:42 +07:00
commit 28e63022dc

View file

@ -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;
}