diff options
author | Andi Kleen <ak@suse.de> | 2006-09-26 04:52:33 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:33 -0400 |
commit | ddb15ec130d38cb8076a9926040c7435b126db65 (patch) | |
tree | 9c0ae01edb41409dfbf376bd60edda46ca70f95b /arch/x86_64/ia32 | |
parent | dd2994f619752fb731f21c89ad16536dd6673948 (diff) |
[PATCH] Fix most sparse warnings in sys_ia32.c
Mostly by adding casts.
I didn't touch the "invalid access past ..." which are caused
by the sigset conversion.
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/ia32')
-rw-r--r-- | arch/x86_64/ia32/sys_ia32.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c index 9c130993380d..33cd0a4fe388 100644 --- a/arch/x86_64/ia32/sys_ia32.c +++ b/arch/x86_64/ia32/sys_ia32.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #include <linux/highuid.h> | 60 | #include <linux/highuid.h> |
61 | #include <linux/vmalloc.h> | 61 | #include <linux/vmalloc.h> |
62 | #include <linux/fsnotify.h> | 62 | #include <linux/fsnotify.h> |
63 | #include <linux/sysctl.h> | ||
63 | #include <asm/mman.h> | 64 | #include <asm/mman.h> |
64 | #include <asm/types.h> | 65 | #include <asm/types.h> |
65 | #include <asm/uaccess.h> | 66 | #include <asm/uaccess.h> |
@@ -389,7 +390,9 @@ sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | |||
389 | } | 390 | } |
390 | } | 391 | } |
391 | set_fs (KERNEL_DS); | 392 | set_fs (KERNEL_DS); |
392 | ret = sys_rt_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL, | 393 | ret = sys_rt_sigprocmask(how, |
394 | set ? (sigset_t __user *)&s : NULL, | ||
395 | oset ? (sigset_t __user *)&s : NULL, | ||
393 | sigsetsize); | 396 | sigsetsize); |
394 | set_fs (old_fs); | 397 | set_fs (old_fs); |
395 | if (ret) return ret; | 398 | if (ret) return ret; |
@@ -541,7 +544,7 @@ sys32_sysinfo(struct sysinfo32 __user *info) | |||
541 | int bitcount = 0; | 544 | int bitcount = 0; |
542 | 545 | ||
543 | set_fs (KERNEL_DS); | 546 | set_fs (KERNEL_DS); |
544 | ret = sys_sysinfo(&s); | 547 | ret = sys_sysinfo((struct sysinfo __user *)&s); |
545 | set_fs (old_fs); | 548 | set_fs (old_fs); |
546 | 549 | ||
547 | /* Check to see if any memory value is too large for 32-bit and scale | 550 | /* Check to see if any memory value is too large for 32-bit and scale |
@@ -589,7 +592,7 @@ sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *int | |||
589 | mm_segment_t old_fs = get_fs (); | 592 | mm_segment_t old_fs = get_fs (); |
590 | 593 | ||
591 | set_fs (KERNEL_DS); | 594 | set_fs (KERNEL_DS); |
592 | ret = sys_sched_rr_get_interval(pid, &t); | 595 | ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t); |
593 | set_fs (old_fs); | 596 | set_fs (old_fs); |
594 | if (put_compat_timespec(&t, interval)) | 597 | if (put_compat_timespec(&t, interval)) |
595 | return -EFAULT; | 598 | return -EFAULT; |
@@ -605,7 +608,7 @@ sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize) | |||
605 | mm_segment_t old_fs = get_fs(); | 608 | mm_segment_t old_fs = get_fs(); |
606 | 609 | ||
607 | set_fs (KERNEL_DS); | 610 | set_fs (KERNEL_DS); |
608 | ret = sys_rt_sigpending(&s, sigsetsize); | 611 | ret = sys_rt_sigpending((sigset_t __user *)&s, sigsetsize); |
609 | set_fs (old_fs); | 612 | set_fs (old_fs); |
610 | if (!ret) { | 613 | if (!ret) { |
611 | switch (_NSIG_WORDS) { | 614 | switch (_NSIG_WORDS) { |
@@ -630,7 +633,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) | |||
630 | if (copy_siginfo_from_user32(&info, uinfo)) | 633 | if (copy_siginfo_from_user32(&info, uinfo)) |
631 | return -EFAULT; | 634 | return -EFAULT; |
632 | set_fs (KERNEL_DS); | 635 | set_fs (KERNEL_DS); |
633 | ret = sys_rt_sigqueueinfo(pid, sig, &info); | 636 | ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info); |
634 | set_fs (old_fs); | 637 | set_fs (old_fs); |
635 | return ret; | 638 | return ret; |
636 | } | 639 | } |
@@ -666,9 +669,6 @@ sys32_sysctl(struct sysctl_ia32 __user *args32) | |||
666 | size_t oldlen; | 669 | size_t oldlen; |
667 | int __user *namep; | 670 | int __user *namep; |
668 | long ret; | 671 | long ret; |
669 | extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, | ||
670 | void *newval, size_t newlen); | ||
671 | |||
672 | 672 | ||
673 | if (copy_from_user(&a32, args32, sizeof (a32))) | 673 | if (copy_from_user(&a32, args32, sizeof (a32))) |
674 | return -EFAULT; | 674 | return -EFAULT; |
@@ -692,7 +692,8 @@ sys32_sysctl(struct sysctl_ia32 __user *args32) | |||
692 | 692 | ||
693 | set_fs(KERNEL_DS); | 693 | set_fs(KERNEL_DS); |
694 | lock_kernel(); | 694 | lock_kernel(); |
695 | ret = do_sysctl(namep, a32.nlen, oldvalp, &oldlen, newvalp, (size_t) a32.newlen); | 695 | ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen, |
696 | newvalp, (size_t) a32.newlen); | ||
696 | unlock_kernel(); | 697 | unlock_kernel(); |
697 | set_fs(old_fs); | 698 | set_fs(old_fs); |
698 | 699 | ||
@@ -743,7 +744,8 @@ sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, s32 count) | |||
743 | return -EFAULT; | 744 | return -EFAULT; |
744 | 745 | ||
745 | set_fs(KERNEL_DS); | 746 | set_fs(KERNEL_DS); |
746 | ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); | 747 | ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __user *)&of : NULL, |
748 | count); | ||
747 | set_fs(old_fs); | 749 | set_fs(old_fs); |
748 | 750 | ||
749 | if (offset && put_user(of, offset)) | 751 | if (offset && put_user(of, offset)) |
@@ -831,7 +833,7 @@ long sys32_ustat(unsigned dev, struct ustat32 __user *u32p) | |||
831 | 833 | ||
832 | seg = get_fs(); | 834 | seg = get_fs(); |
833 | set_fs(KERNEL_DS); | 835 | set_fs(KERNEL_DS); |
834 | ret = sys_ustat(dev,&u); | 836 | ret = sys_ustat(dev, (struct ustat __user *)&u); |
835 | set_fs(seg); | 837 | set_fs(seg); |
836 | if (ret >= 0) { | 838 | if (ret >= 0) { |
837 | if (!access_ok(VERIFY_WRITE,u32p,sizeof(struct ustat32)) || | 839 | if (!access_ok(VERIFY_WRITE,u32p,sizeof(struct ustat32)) || |