diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2024-10-31 15:20:17 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-11-07 17:34:50 +0100 |
commit | 81e0679d851ad7ddee8904df59f84eabfc2c1b1e (patch) | |
tree | 2b6843779473fc047b7f07b4042a827304977be9 /arch/x86 | |
parent | um: fix sparse warnings from regset refactor (diff) | |
download | linux-81e0679d851ad7ddee8904df59f84eabfc2c1b1e.tar.xz linux-81e0679d851ad7ddee8904df59f84eabfc2c1b1e.zip |
um: fix sparse warnings in signal code
sparse reports that various places were missing the __user tag in casts.
In addition, one location was using 0 instead of NULL.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20241031142017.430420-2-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/um/signal.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c index 797c4e4e57f3..75087e85b6fd 100644 --- a/arch/x86/um/signal.c +++ b/arch/x86/um/signal.c @@ -242,7 +242,7 @@ int setup_signal_stack_sc(unsigned long stack_top, struct ksignal *ksig, if (ksig->ka.sa.sa_flags & SA_RESTORER) restorer = ksig->ka.sa.sa_restorer; - err |= __put_user(restorer, (void **)&frame->pretcode); + err |= __put_user(restorer, (void __user * __user *)&frame->pretcode); err |= __put_user(sig, &frame->sig); fp_to = (unsigned long)frame + sizeof(*frame); @@ -298,10 +298,10 @@ int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig, if (ksig->ka.sa.sa_flags & SA_RESTORER) restorer = ksig->ka.sa.sa_restorer; - err |= __put_user(restorer, (void **)&frame->pretcode); + err |= __put_user(restorer, (void __user * __user *)&frame->pretcode); err |= __put_user(sig, &frame->sig); - err |= __put_user(&frame->info, (void **)&frame->pinfo); - err |= __put_user(&frame->uc, (void **)&frame->puc); + err |= __put_user(&frame->info, (void __user * __user *)&frame->pinfo); + err |= __put_user(&frame->uc, (void __user * __user *)&frame->puc); err |= copy_siginfo_to_user(&frame->info, &ksig->info); fp_to = (unsigned long)frame + sizeof(*frame); @@ -387,7 +387,7 @@ int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig, /* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); - err |= __put_user(0, &frame->uc.uc_link); + err |= __put_user(NULL, &frame->uc.uc_link); err |= __save_altstack(&frame->uc.uc_stack, PT_REGS_SP(regs)); fp_to = (unsigned long)frame + sizeof(*frame); @@ -411,7 +411,7 @@ int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig, */ /* x86-64 should always use SA_RESTORER. */ if (ksig->ka.sa.sa_flags & SA_RESTORER) - err |= __put_user((void *)ksig->ka.sa.sa_restorer, + err |= __put_user((void __user *)ksig->ka.sa.sa_restorer, &frame->pretcode); else /* could use a vstub here */ |