diff options
author | Mathias Krause <minipli@googlemail.com> | 2012-09-02 17:31:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-09-05 04:52:24 -0400 |
commit | 0ff8fef4eaf252ee13a2d0b175a8c876415bd62a (patch) | |
tree | 7547209745a668568ac000a661f687b46e701afd /arch/x86/ia32/ia32_signal.c | |
parent | 3d1334064fb365ea8f299874c2b4c46de2bee74d (diff) |
x86/signals: ia32_signal.c: add __user casts to fix sparse warnings
Fix the following sparse warnings by adding appropriate __user
casts and annotations:
ia32_signal.c:165:38: warning: incorrect type in argument 1 (different address spaces)
ia32_signal.c:165:38: expected struct sigaltstack const [noderef] [usertype] <asn:1>*<noident>
ia32_signal.c:165:38: got struct sigaltstack *
[...]
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/1346621506-30857-4-git-send-email-minipli@googlemail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/ia32/ia32_signal.c')
-rw-r--r-- | arch/x86/ia32/ia32_signal.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 673ac9b63d6b..452d4dd0a95a 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -162,7 +162,8 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr, | |||
162 | } | 162 | } |
163 | seg = get_fs(); | 163 | seg = get_fs(); |
164 | set_fs(KERNEL_DS); | 164 | set_fs(KERNEL_DS); |
165 | ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp); | 165 | ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL), |
166 | (stack_t __force __user *) &uoss, regs->sp); | ||
166 | set_fs(seg); | 167 | set_fs(seg); |
167 | if (ret >= 0 && uoss_ptr) { | 168 | if (ret >= 0 && uoss_ptr) { |
168 | if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t))) | 169 | if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t))) |
@@ -361,7 +362,7 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc, | |||
361 | */ | 362 | */ |
362 | static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | 363 | static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, |
363 | size_t frame_size, | 364 | size_t frame_size, |
364 | void **fpstate) | 365 | void __user **fpstate) |
365 | { | 366 | { |
366 | unsigned long sp; | 367 | unsigned long sp; |
367 | 368 | ||
@@ -382,7 +383,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | |||
382 | 383 | ||
383 | if (used_math()) { | 384 | if (used_math()) { |
384 | sp = sp - sig_xstate_ia32_size; | 385 | sp = sp - sig_xstate_ia32_size; |
385 | *fpstate = (struct _fpstate_ia32 *) sp; | 386 | *fpstate = (struct _fpstate_ia32 __user *) sp; |
386 | if (save_i387_xstate_ia32(*fpstate) < 0) | 387 | if (save_i387_xstate_ia32(*fpstate) < 0) |
387 | return (void __user *) -1L; | 388 | return (void __user *) -1L; |
388 | } | 389 | } |
@@ -448,7 +449,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka, | |||
448 | * These are actually not used anymore, but left because some | 449 | * These are actually not used anymore, but left because some |
449 | * gdb versions depend on them as a marker. | 450 | * gdb versions depend on them as a marker. |
450 | */ | 451 | */ |
451 | put_user_ex(*((u64 *)&code), (u64 *)frame->retcode); | 452 | put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode); |
452 | } put_user_catch(err); | 453 | } put_user_catch(err); |
453 | 454 | ||
454 | if (err) | 455 | if (err) |
@@ -529,7 +530,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
529 | * Not actually used anymore, but left because some gdb | 530 | * Not actually used anymore, but left because some gdb |
530 | * versions need it. | 531 | * versions need it. |
531 | */ | 532 | */ |
532 | put_user_ex(*((u64 *)&code), (u64 *)frame->retcode); | 533 | put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode); |
533 | } put_user_catch(err); | 534 | } put_user_catch(err); |
534 | 535 | ||
535 | if (err) | 536 | if (err) |