]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sparse: trivial part of kernel/* __user annotation
authorAlexander Viro <viro@www.linux.org.uk>
Sat, 29 May 2004 04:15:01 +0000 (21:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 29 May 2004 04:15:01 +0000 (21:15 -0700)
arch/mips/kernel/irixsig.c
arch/mips/kernel/sysirix.c
include/linux/compat.h
include/linux/syscalls.h
kernel/acct.c
kernel/compat.c
kernel/exit.c
kernel/futex.c
kernel/sys.c
kernel/time.c

index 0a34f4661bbae84360ce3ec74aca694f66596e2b..b15f3b0de4741794a05c2315677391381de8b823 100644 (file)
@@ -549,7 +549,7 @@ out:
 #define P_PGID   2
 #define P_ALL    7
 
-extern int getrusage(struct task_struct *, int, struct rusage *);
+extern int getrusage(struct task_struct *, int, struct rusage __user *);
 
 #define W_EXITED     1
 #define W_TRAPPED    2
index 1b10357abc7e1f5cb2e5d645acfcdc89ae80c4d2..25d7e97edfca2a59bb2f3ec1a20ec810a870eb99 100644 (file)
@@ -235,7 +235,7 @@ asmlinkage int irix_prctl(struct pt_regs *regs)
 #undef DEBUG_PROCGRPS
 
 extern unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt);
-extern int getrusage(struct task_struct *p, int who, struct rusage *ru);
+extern int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
 extern char *prom_getenv(char *name);
 extern long prom_setenv(char *name, char *value);
 
index c32eeabf5d1bf03ca665082bba425611e24c1ece..e45c0f905451ac2f4696dac1010c7f30bcd833ba 100644 (file)
@@ -46,9 +46,9 @@ typedef struct {
        compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
 } compat_sigset_t;
 
-extern int cp_compat_stat(struct kstat *, struct compat_stat *);
-extern int get_compat_timespec(struct timespec *, const struct compat_timespec *);
-extern int put_compat_timespec(const struct timespec *, struct compat_timespec *);
+extern int cp_compat_stat(struct kstat *, struct compat_stat __user *);
+extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *);
+extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *);
 
 struct compat_iovec {
        compat_uptr_t   iov_base;
index 5ee0332425ea3939732863ed5c10c8abfdc6d35b..a7fea38aeacd59c9c698646f5890d57e20ecbeb4 100644 (file)
@@ -160,7 +160,7 @@ asmlinkage long sys_kexec_load(void *entry, unsigned long nr_segments,
 
 asmlinkage long sys_exit(int error_code);
 asmlinkage void sys_exit_group(int error_code);
-asmlinkage long sys_wait4(pid_t pid, unsigned int *stat_addr,
+asmlinkage long sys_wait4(pid_t pid, unsigned int __user *stat_addr,
                                int options, struct rusage __user *ru);
 asmlinkage long sys_waitpid(pid_t pid, unsigned int __user *stat_addr, int options);
 asmlinkage long sys_set_tid_address(int __user *tidptr);
index 555e1e3c349ffb1639dcc8d9139e2778c27a9425..f0e2bd0458d2f43fc7516dd5b78b3c1535e70686 100644 (file)
@@ -204,7 +204,7 @@ void acct_file_reopen(struct file *file)
  *  should be written. If the filename is NULL, accounting will be
  *  shutdown.
  */
-asmlinkage long sys_acct(const char *name)
+asmlinkage long sys_acct(const char __user *name)
 {
        struct file *file = NULL;
        char *tmp;
index f05cda344b4d3fb5a59ba34b24eabeffd53de79d..9dccddd331a39f191dd3378b9769bdc7b8dc3d8d 100644 (file)
 
 #include <asm/uaccess.h>
 
-int get_compat_timespec(struct timespec *ts, const struct compat_timespec *cts)
+int get_compat_timespec(struct timespec *ts, const struct compat_timespec __user *cts)
 {
        return (verify_area(VERIFY_READ, cts, sizeof(*cts)) ||
                        __get_user(ts->tv_sec, &cts->tv_sec) ||
                        __get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
 }
 
-int put_compat_timespec(const struct timespec *ts, struct compat_timespec *cts)
+int put_compat_timespec(const struct timespec *ts, struct compat_timespec __user *cts)
 {
        return (verify_area(VERIFY_WRITE, cts, sizeof(*cts)) ||
                        __put_user(ts->tv_sec, &cts->tv_sec) ||
@@ -40,7 +40,7 @@ int put_compat_timespec(const struct timespec *ts, struct compat_timespec *cts)
 static long compat_nanosleep_restart(struct restart_block *restart)
 {
        unsigned long expire = restart->arg0, now = jiffies;
-       struct compat_timespec *rmtp;
+       struct compat_timespec __user *rmtp;
 
        /* Did it expire while we handled signals? */
        if (!time_after(expire, now))
@@ -51,7 +51,7 @@ static long compat_nanosleep_restart(struct restart_block *restart)
        if (expire == 0)
                return 0;
 
-       rmtp = (struct compat_timespec *)restart->arg1;
+       rmtp = (struct compat_timespec __user *)restart->arg1;
        if (rmtp) {
                struct compat_timespec ct;
                struct timespec t;
@@ -66,8 +66,8 @@ static long compat_nanosleep_restart(struct restart_block *restart)
        return -ERESTART_RESTARTBLOCK;
 }
 
-asmlinkage long compat_sys_nanosleep(struct compat_timespec *rqtp,
-               struct compat_timespec *rmtp)
+asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
+               struct compat_timespec __user *rmtp)
 {
        struct timespec t;
        struct restart_block *restart;
@@ -98,7 +98,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec *rqtp,
 }
 
 static inline long get_compat_itimerval(struct itimerval *o,
-               struct compat_itimerval *i)
+               struct compat_itimerval __user *i)
 {
        return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
                (__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) |
@@ -107,7 +107,7 @@ static inline long get_compat_itimerval(struct itimerval *o,
                 __get_user(o->it_value.tv_usec, &i->it_value.tv_usec)));
 }
 
-static inline long put_compat_itimerval(struct compat_itimerval *o,
+static inline long put_compat_itimerval(struct compat_itimerval __user *o,
                struct itimerval *i)
 {
        return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
@@ -117,7 +117,8 @@ static inline long put_compat_itimerval(struct compat_itimerval *o,
                 __put_user(i->it_value.tv_usec, &o->it_value.tv_usec)));
 }
 
-asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it)
+asmlinkage long compat_sys_getitimer(int which,
+               struct compat_itimerval __user *it)
 {
        struct itimerval kit;
        int error;
@@ -128,8 +129,9 @@ asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it)
        return error;
 }
 
-asmlinkage long compat_sys_setitimer(int which, struct compat_itimerval *in,
-               struct compat_itimerval *out)
+asmlinkage long compat_sys_setitimer(int which,
+               struct compat_itimerval __user *in,
+               struct compat_itimerval __user *out)
 {
        struct itimerval kin, kout;
        int error;
@@ -148,7 +150,7 @@ asmlinkage long compat_sys_setitimer(int which, struct compat_itimerval *in,
        return 0;
 }
 
-asmlinkage long compat_sys_times(struct compat_tms *tbuf)
+asmlinkage long compat_sys_times(struct compat_tms __user *tbuf)
 {
        /*
         *      In the SMP world we might just be unlucky and have one of
@@ -173,7 +175,7 @@ asmlinkage long compat_sys_times(struct compat_tms *tbuf)
  * types that can be passed to put_user()/get_user().
  */
 
-asmlinkage long compat_sys_sigpending(compat_old_sigset_t *set)
+asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
 {
        old_sigset_t s;
        long ret;
@@ -187,8 +189,8 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t *set)
        return ret;
 }
 
-asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
-               compat_old_sigset_t *oset)
+asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
+               compat_old_sigset_t __user *oset)
 {
        old_sigset_t s;
        long ret;
@@ -207,8 +209,8 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
 }
 
 #ifdef CONFIG_FUTEX
-asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val,
-               struct compat_timespec *utime, u32 *uaddr2)
+asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, int val,
+               struct compat_timespec __user *utime, u32 __user *uaddr2)
 {
        struct timespec t;
        unsigned long timeout = MAX_SCHEDULE_TIMEOUT;
@@ -227,7 +229,8 @@ asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val,
 }
 #endif
 
-asmlinkage long compat_sys_setrlimit(unsigned int resource, struct compat_rlimit *rlim)
+asmlinkage long compat_sys_setrlimit(unsigned int resource,
+               struct compat_rlimit __user *rlim)
 {
        struct rlimit r;
        int ret;
@@ -253,7 +256,8 @@ asmlinkage long compat_sys_setrlimit(unsigned int resource, struct compat_rlimit
 
 #ifdef COMPAT_RLIM_OLD_INFINITY
 
-asmlinkage long compat_sys_old_getrlimit(unsigned int resource, struct compat_rlimit *rlim)
+asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
+               struct compat_rlimit __user *rlim)
 {
        struct rlimit r;
        int ret;
@@ -279,7 +283,8 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource, struct compat_rl
 
 #endif
 
-asmlinkage long compat_sys_getrlimit (unsigned int resource, struct compat_rlimit *rlim)
+asmlinkage long compat_sys_getrlimit (unsigned int resource,
+               struct compat_rlimit __user *rlim)
 {
        struct rlimit r;
        int ret;
@@ -302,7 +307,7 @@ asmlinkage long compat_sys_getrlimit (unsigned int resource, struct compat_rlimi
        return ret;
 }
 
-static long put_compat_rusage (struct compat_rusage *ru, struct rusage *r)
+static long put_compat_rusage(struct compat_rusage __user *ru, struct rusage *r)
 {
        if (!access_ok(VERIFY_WRITE, ru, sizeof(*ru)) ||
            __put_user(r->ru_utime.tv_sec, &ru->ru_utime.tv_sec) ||
@@ -327,7 +332,7 @@ static long put_compat_rusage (struct compat_rusage *ru, struct rusage *r)
        return 0;
 }
 
-asmlinkage long compat_sys_getrusage(int who, struct compat_rusage *ru)
+asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
 {
        struct rusage r;
        int ret;
@@ -347,8 +352,8 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage *ru)
 }
 
 asmlinkage long
-compat_sys_wait4(compat_pid_t pid, compat_uint_t stat_addr, int options,
-       struct compat_rusage *ru)
+compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options,
+       struct compat_rusage __user *ru)
 {
        if (!ru) {
                return sys_wait4(pid, stat_addr, options, NULL);
@@ -374,7 +379,7 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options,
 
 asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid, 
                                             unsigned int len,
-                                            compat_ulong_t *user_mask_ptr)
+                                            compat_ulong_t __user *user_mask_ptr)
 {
        unsigned long kernel_mask;
        mm_segment_t old_fs;
@@ -394,7 +399,7 @@ asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
 }
 
 asmlinkage int compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
-                                           compat_ulong_t *user_mask_ptr)
+                                          compat_ulong_t __user *user_mask_ptr)
 {
        unsigned long kernel_mask;
        mm_segment_t old_fs;
@@ -417,7 +422,7 @@ asmlinkage int compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
 }
 
 static int get_compat_itimerspec(struct itimerspec *dst, 
-                                struct compat_itimerspec *src)
+                                struct compat_itimerspec __user *src)
 { 
        if (get_compat_timespec(&dst->it_interval, &src->it_interval) ||
            get_compat_timespec(&dst->it_value, &src->it_value))
@@ -425,7 +430,7 @@ static int get_compat_itimerspec(struct itimerspec *dst,
        return 0;
 } 
 
-static int put_compat_itimerspec(struct compat_itimerspec *dst, 
+static int put_compat_itimerspec(struct compat_itimerspec __user *dst, 
                                 struct itimerspec *src)
 { 
        if (put_compat_timespec(&src->it_interval, &dst->it_interval) ||
@@ -435,8 +440,8 @@ static int put_compat_itimerspec(struct compat_itimerspec *dst,
 } 
 
 long compat_timer_settime(timer_t timer_id, int flags, 
-                         struct compat_itimerspec *new, 
-                         struct compat_itimerspec *old)
+                         struct compat_itimerspec __user *new, 
+                         struct compat_itimerspec __user *old)
 { 
        long err;
        mm_segment_t oldfs;
@@ -455,7 +460,8 @@ long compat_timer_settime(timer_t timer_id, int flags,
        return err;
 } 
 
-long compat_timer_gettime(timer_t timer_id, struct compat_itimerspec *setting)
+long compat_timer_gettime(timer_t timer_id,
+               struct compat_itimerspec __user *setting)
 { 
        long err;
        mm_segment_t oldfs;
@@ -469,7 +475,8 @@ long compat_timer_gettime(timer_t timer_id, struct compat_itimerspec *setting)
        return err;
 } 
 
-long compat_clock_settime(clockid_t which_clock,  struct compat_timespec *tp)
+long compat_clock_settime(clockid_t which_clock,
+               struct compat_timespec __user *tp)
 {
        long err;
        mm_segment_t oldfs;
@@ -483,7 +490,8 @@ long compat_clock_settime(clockid_t which_clock,  struct compat_timespec *tp)
        return err;
 } 
 
-long compat_clock_gettime(clockid_t which_clock,  struct compat_timespec *tp)
+long compat_clock_gettime(clockid_t which_clock,
+               struct compat_timespec __user *tp)
 {
        long err;
        mm_segment_t oldfs;
@@ -497,7 +505,8 @@ long compat_clock_gettime(clockid_t which_clock,  struct compat_timespec *tp)
        return err;
 } 
 
-long compat_clock_getres(clockid_t which_clock,  struct compat_timespec *tp)
+long compat_clock_getres(clockid_t which_clock,
+               struct compat_timespec __user *tp)
 {
        long err;
        mm_segment_t oldfs;
index 1053be962cad5f9cf1cbc6236cb6426bb5cd39f2..8c1a599db266e1dc515e54c6bc53c289d3a8952a 100644 (file)
@@ -32,7 +32,7 @@
 extern void sem_exit (void);
 extern struct task_struct *child_reaper;
 
-int getrusage(struct task_struct *, int, struct rusage *);
+int getrusage(struct task_struct *, int, struct rusage __user *);
 
 static void __unhash_process(struct task_struct *p)
 {
@@ -936,7 +936,7 @@ static int eligible_child(pid_t pid, int options, task_t *p)
  * the lock and this task is uninteresting.  If we return nonzero, we have
  * released the lock and the system call should return.
  */
-static int wait_task_zombie(task_t *p, unsigned int *stat_addr, struct rusage *ru)
+static int wait_task_zombie(task_t *p, unsigned int __user *stat_addr, struct rusage __user *ru)
 {
        unsigned long state;
        int retval;
@@ -1009,7 +1009,8 @@ static int wait_task_zombie(task_t *p, unsigned int *stat_addr, struct rusage *r
  * released the lock and the system call should return.
  */
 static int wait_task_stopped(task_t *p, int delayed_group_leader,
-                            unsigned int *stat_addr, struct rusage *ru)
+                            unsigned int __user *stat_addr,
+                            struct rusage __user *ru)
 {
        int retval, exit_code;
 
@@ -1079,7 +1080,7 @@ static int wait_task_stopped(task_t *p, int delayed_group_leader,
        return retval;
 }
 
-asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru)
+asmlinkage long sys_wait4(pid_t pid,unsigned int __user *stat_addr, int options, struct rusage __user *ru)
 {
        DECLARE_WAITQUEUE(wait, current);
        struct task_struct *tsk;
@@ -1168,7 +1169,7 @@ end_wait4:
  * sys_waitpid() remains for compatibility. waitpid() should be
  * implemented by calling sys_wait4() from libc.a.
  */
-asmlinkage long sys_waitpid(pid_t pid,unsigned int * stat_addr, int options)
+asmlinkage long sys_waitpid(pid_t pid, unsigned __user *stat_addr, int options)
 {
        return sys_wait4(pid, stat_addr, options, NULL);
 }
index 93f7ea6f80be4f3876dcf43994e450d0200ceb83..18d5119d27ba7f84590b56ffa503839f5aa7905f 100644 (file)
@@ -459,7 +459,7 @@ static int futex_wait(unsigned long uaddr, int val, unsigned long time)
         * We hold the mmap semaphore, so the mapping cannot have changed
         * since we looked it up.
         */
-       if (get_user(curval, (int *)uaddr) != 0) {
+       if (get_user(curval, (int __user *)uaddr) != 0) {
                ret = -EFAULT;
                goto out_unqueue;
        }
index 769b86f0e663ec164fe4622147f5844a975e1484..d22fd2d124a8da1e86e9775d4d125173aef368f1 100644 (file)
@@ -819,7 +819,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
        return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RES);
 }
 
-asmlinkage long sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
+asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid)
 {
        int retval;
 
@@ -868,7 +868,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
        return 0;
 }
 
-asmlinkage long sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
+asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid)
 {
        int retval;
 
index f60c5da45723b8e81ad3b18a771aaba0a069483f..68c22f2bf4527254c90121c03b5ebbd110928eb0 100644 (file)
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(sys_tz);
  *
  * XXX This function is NOT 64-bit clean!
  */
-asmlinkage long sys_time(int * tloc)
+asmlinkage long sys_time(int __user * tloc)
 {
        int i;
        struct timeval tv;
@@ -71,7 +71,7 @@ asmlinkage long sys_time(int * tloc)
  * architectures that need it).
  */
  
-asmlinkage long sys_stime(time_t *tptr)
+asmlinkage long sys_stime(time_t __user *tptr)
 {
        struct timespec tv;