From 28e63022dc9c4ea72cb015e33aadd476c0c4c25f Mon Sep 17 00:00:00 2001 From: Sorayukii Date: Mon, 16 Mar 2026 12:32:42 +0700 Subject: [PATCH] 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 --- fs/verity/enable.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/verity/enable.c b/fs/verity/enable.c index cd63b90ecf87..1f269d87f725 100644 --- a/fs/verity/enable.c +++ b/fs/verity/enable.c @@ -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; }