diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-09 07:19:26 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-09 07:19:26 -0700 |
| commit | 2f5c576e4ec4ee284b56fc6416d53c736aa82b87 (patch) | |
| tree | 756373477b6533eb6f8e84e57b47fe5a69c44fa4 | |
| parent | 9709b8137d14557b6a5d336dd1c6c9674a8a4263 (diff) | |
| parent | c8690d4ec40a8b8e97f5f62786bae229f53c6bd9 (diff) | |
Merge bk://linux-dj.bkbits.net/agpgart
into home.transmeta.com:/home/torvalds/v2.5/linux
| -rw-r--r-- | include/linux/sysctl.h | 8 | ||||
| -rw-r--r-- | kernel/posix-timers.c | 24 | ||||
| -rw-r--r-- | kernel/printk.c | 4 | ||||
| -rw-r--r-- | kernel/ptrace.c | 19 | ||||
| -rw-r--r-- | kernel/softirq.c | 4 | ||||
| -rw-r--r-- | kernel/sysctl.c | 51 | ||||
| -rw-r--r-- | kernel/time.c | 6 | ||||
| -rw-r--r-- | kernel/uid16.c | 4 |
8 files changed, 61 insertions, 59 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index f6a32a5dc496..79b779f29c9f 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -679,8 +679,8 @@ extern void sysctl_init(void); typedef struct ctl_table ctl_table; typedef int ctl_handler (ctl_table *table, int *name, int nlen, - void *oldval, size_t *oldlenp, - void *newval, size_t newlen, + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, void **context); typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, @@ -707,8 +707,8 @@ extern int do_sysctl (int *name, int nlen, extern int do_sysctl_strategy (ctl_table *table, int *name, int nlen, - void *oldval, size_t *oldlenp, - void *newval, size_t newlen, void ** context); + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, void ** context); extern ctl_handler sysctl_string; extern ctl_handler sysctl_intvec; diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index e12314e3b4cb..391272d79985 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -341,7 +341,7 @@ static void posix_timer_fn(unsigned long __data) * Here we define a mask to get rid of the common bits. The * optimizer should make this costless to all but mips. */ -#if (ARCH == mips) || (ARCH == mips64) +#if defined(ARCH) && ((ARCH == mips) || (ARCH == mips64)) #define MIPS_SIGEV ~(SIGEV_NONE & \ SIGEV_SIGNAL & \ SIGEV_THREAD & \ @@ -402,7 +402,8 @@ static void release_posix_timer(struct k_itimer *tmr) asmlinkage long sys_timer_create(clockid_t which_clock, - struct sigevent *timer_event_spec, timer_t * created_timer_id) + struct sigevent __user *timer_event_spec, + timer_t __user * created_timer_id) { int error = 0; struct k_itimer *new_timer = NULL; @@ -623,7 +624,7 @@ do_timer_gettime(struct k_itimer *timr, struct itimerspec *cur_setting) /* Get the time remaining on a POSIX.1b interval timer. */ asmlinkage long -sys_timer_gettime(timer_t timer_id, struct itimerspec *setting) +sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting) { struct k_itimer *timr; struct itimerspec cur_setting; @@ -801,8 +802,8 @@ do_timer_settime(struct k_itimer *timr, int flags, /* Set a POSIX.1b interval timer */ asmlinkage long sys_timer_settime(timer_t timer_id, int flags, - const struct itimerspec *new_setting, - struct itimerspec *old_setting) + const struct itimerspec __user *new_setting, + struct itimerspec __user *old_setting) { struct k_itimer *timr; struct itimerspec new_spec, old_spec; @@ -985,7 +986,7 @@ int do_posix_clock_monotonic_settime(struct timespec *tp) } asmlinkage long -sys_clock_settime(clockid_t which_clock, const struct timespec *tp) +sys_clock_settime(clockid_t which_clock, const struct timespec __user *tp) { struct timespec new_tp; @@ -1002,7 +1003,7 @@ sys_clock_settime(clockid_t which_clock, const struct timespec *tp) } asmlinkage long -sys_clock_gettime(clockid_t which_clock, struct timespec *tp) +sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp) { struct timespec rtn_tp; int error = 0; @@ -1021,7 +1022,7 @@ sys_clock_gettime(clockid_t which_clock, struct timespec *tp) } asmlinkage long -sys_clock_getres(clockid_t which_clock, struct timespec *tp) +sys_clock_getres(clockid_t which_clock, struct timespec __user *tp) { struct timespec rtn_tp; @@ -1074,7 +1075,7 @@ extern long do_clock_nanosleep(clockid_t which_clock, int flags, #ifdef FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP asmlinkage long -sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp) +sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp) { struct timespec t; long ret; @@ -1096,7 +1097,8 @@ sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp) asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags, - const struct timespec *rqtp, struct timespec *rmtp) + const struct timespec __user *rqtp, + struct timespec __user *rmtp) { struct timespec t; int ret; @@ -1218,7 +1220,7 @@ clock_nanosleep_restart(struct restart_block *restart_block) int ret = do_clock_nanosleep(restart_block->arg0, 0, &t); if ((ret == -ERESTART_RESTARTBLOCK) && restart_block->arg1 && - copy_to_user((struct timespec *)(restart_block->arg1), &t, + copy_to_user((struct timespec __user *)(restart_block->arg1), &t, sizeof (t))) return -EFAULT; return ret; diff --git a/kernel/printk.c b/kernel/printk.c index 853ac68708ae..4872b4490561 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -155,7 +155,7 @@ __setup("console=", console_setup); * 8 -- Set level of messages printed to console * 9 -- Return number of unread characters in the log buffer */ -int do_syslog(int type, char * buf, int len) +int do_syslog(int type, char __user * buf, int len) { unsigned long i, j, limit, count; int do_clear = 0; @@ -276,7 +276,7 @@ out: return error; } -asmlinkage long sys_syslog(int type, char * buf, int len) +asmlinkage long sys_syslog(int type, char __user * buf, int len) { return do_syslog(type, buf, len); } diff --git a/kernel/ptrace.c b/kernel/ptrace.c index bed9bd42525b..a971c2a43185 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -200,7 +200,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in return buf - old_buf; } -int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len) +int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len) { int copied = 0; @@ -225,7 +225,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int l return copied; } -int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int len) +int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len) { int copied = 0; @@ -278,19 +278,18 @@ static int ptrace_setoptions(struct task_struct *child, long data) return (data & ~PTRACE_O_MASK) ? -EINVAL : 0; } -static int ptrace_getsiginfo(struct task_struct *child, long data) +static int ptrace_getsiginfo(struct task_struct *child, siginfo_t __user * data) { if (child->last_siginfo == NULL) return -EINVAL; - return copy_siginfo_to_user ((siginfo_t *) data, child->last_siginfo); + return copy_siginfo_to_user(data, child->last_siginfo); } -static int ptrace_setsiginfo(struct task_struct *child, long data) +static int ptrace_setsiginfo(struct task_struct *child, siginfo_t __user * data) { if (child->last_siginfo == NULL) return -EINVAL; - if (copy_from_user (child->last_siginfo, (siginfo_t *) data, - sizeof (siginfo_t)) != 0) + if (copy_from_user(child->last_siginfo, data, sizeof (siginfo_t)) != 0) return -EFAULT; return 0; } @@ -308,13 +307,13 @@ int ptrace_request(struct task_struct *child, long request, ret = ptrace_setoptions(child, data); break; case PTRACE_GETEVENTMSG: - ret = put_user(child->ptrace_message, (unsigned long *) data); + ret = put_user(child->ptrace_message, (unsigned long __user *) data); break; case PTRACE_GETSIGINFO: - ret = ptrace_getsiginfo(child, data); + ret = ptrace_getsiginfo(child, (siginfo_t __user *) data); break; case PTRACE_SETSIGINFO: - ret = ptrace_setsiginfo(child, data); + ret = ptrace_setsiginfo(child, (siginfo_t __user *) data); break; default: break; diff --git a/kernel/softirq.c b/kernel/softirq.c index 53ef1cb8db96..79ed6b9cbdee 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -51,7 +51,7 @@ static inline void wakeup_softirqd(unsigned cpu) wake_up_process(tsk); } -asmlinkage void do_softirq() +asmlinkage void do_softirq(void) { __u32 pending; unsigned long flags; @@ -296,7 +296,7 @@ static struct notifier_block tasklet_nb = { .next = NULL, }; -void __init softirq_init() +void __init softirq_init(void) { open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL); open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL); diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 21381e2efa18..aff65582bd21 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -403,7 +403,7 @@ int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, return -ENOTDIR; } -extern asmlinkage long sys_sysctl(struct __sysctl_args *args) +asmlinkage long sys_sysctl(struct __sysctl_args __user *args) { struct __sysctl_args tmp; int error; @@ -444,8 +444,8 @@ static inline int ctl_perm(ctl_table *table, int op) } static int parse_table(int *name, int nlen, - void *oldval, size_t *oldlenp, - void *newval, size_t newlen, + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, ctl_table *table, void **context) { int n; @@ -485,8 +485,8 @@ repeat: /* Perform the actual read/write of a sysctl table entry. */ int do_sysctl_strategy (ctl_table *table, int *name, int nlen, - void *oldval, size_t *oldlenp, - void *newval, size_t newlen, void **context) + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, void **context) { int op = 0, rc; size_t len; @@ -787,10 +787,11 @@ static int proc_sys_permission(struct inode *inode, int op) * Returns 0 on success. */ int proc_dostring(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { size_t len; - char *p, c; + char __user *p; + char c; if (!table->data || !table->maxlen || !*lenp || (filp->f_pos && !write)) { @@ -840,7 +841,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp, */ static int proc_doutsstring(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { int r; @@ -863,7 +864,7 @@ static int proc_doutsstring(ctl_table *table, int write, struct file *filp, #define OP_MIN 4 static int do_proc_dointvec(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp, int conv, int op) + void __user *buffer, size_t *lenp, int conv, int op) { int *i, vleft, first=1, neg, val; size_t left, len; @@ -885,12 +886,12 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp, if (write) { while (left) { char c; - if(get_user(c,(char *) buffer)) + if (get_user(c,(char __user *) buffer)) return -EFAULT; if (!isspace(c)) break; left--; - ((char *) buffer)++; + buffer++; } if (!left) break; @@ -979,7 +980,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp, * Returns 0 on success. */ int proc_dointvec(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { return do_proc_dointvec(table,write,filp,buffer,lenp,1,OP_SET); } @@ -989,7 +990,7 @@ int proc_dointvec(ctl_table *table, int write, struct file *filp, */ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { if (!capable(CAP_SYS_MODULE)) { return -EPERM; @@ -1015,7 +1016,7 @@ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp, * Returns 0 on success. */ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { int *i, *min, *max, vleft, first=1, neg, val; size_t len, left; @@ -1043,7 +1044,7 @@ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp, if (!isspace(c)) break; left--; - ((char *) buffer)++; + buffer++; } if (!left) break; @@ -1113,7 +1114,7 @@ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp, static int do_proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp, + void __user *buffer, size_t *lenp, unsigned long convmul, unsigned long convdiv) { @@ -1139,12 +1140,12 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write, if (write) { while (left) { char c; - if(get_user(c, (char *) buffer)) + if (get_user(c, (char __user *) buffer)) return -EFAULT; if (!isspace(c)) break; left--; - ((char *) buffer)++; + buffer++; } if (!left) break; @@ -1152,7 +1153,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write, len = left; if (len > TMPBUFLEN-1) len = TMPBUFLEN-1; - if(copy_from_user(buf, buffer, len)) + if (copy_from_user(buf, buffer, len)) return -EFAULT; buf[len] = 0; p = buf; @@ -1232,7 +1233,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write, * Returns 0 on success. */ int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, 1l, 1l); } @@ -1256,7 +1257,7 @@ int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp, */ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, HZ, 1000l); @@ -1279,7 +1280,7 @@ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write, * Returns 0 on success. */ int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) + void __user *buffer, size_t *lenp) { return do_proc_dointvec(table,write,filp,buffer,lenp,HZ,OP_SET); } @@ -1345,8 +1346,8 @@ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write, /* The generic string strategy routine: */ int sysctl_string(ctl_table *table, int *name, int nlen, - void *oldval, size_t *oldlenp, - void *newval, size_t newlen, void **context) + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, void **context) { size_t l, len; @@ -1453,7 +1454,7 @@ int sysctl_jiffies(ctl_table *table, int *name, int nlen, #else /* CONFIG_SYSCTL */ -extern asmlinkage long sys_sysctl(struct __sysctl_args *args) +extern asmlinkage long sys_sysctl(struct __sysctl_args __user *args) { return -ENOSYS; } diff --git a/kernel/time.c b/kernel/time.c index 4ecc0a3b2ac1..3af9c7d07b90 100644 --- a/kernel/time.c +++ b/kernel/time.c @@ -90,7 +90,7 @@ asmlinkage long sys_stime(int * tptr) #endif -asmlinkage long sys_gettimeofday(struct timeval *tv, struct timezone *tz) +asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __user *tz) { if (likely(tv != NULL)) { struct timeval ktv; @@ -166,7 +166,7 @@ int do_sys_settimeofday(struct timeval *tv, struct timezone *tz) return 0; } -asmlinkage long sys_settimeofday(struct timeval *tv, struct timezone *tz) +asmlinkage long sys_settimeofday(struct timeval __user *tv, struct timezone __user *tz) { struct timeval new_tv; struct timezone new_tz; @@ -387,7 +387,7 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0 return(result); } -asmlinkage long sys_adjtimex(struct timex *txc_p) +asmlinkage long sys_adjtimex(struct timex __user *txc_p) { struct timex txc; /* Local copy of parameter */ int ret; diff --git a/kernel/uid16.c b/kernel/uid16.c index 6158db4e718f..5ba0feafe6cd 100644 --- a/kernel/uid16.c +++ b/kernel/uid16.c @@ -107,7 +107,7 @@ asmlinkage long sys_setfsgid16(old_gid_t gid) return sys_setfsgid((gid_t)gid); } -asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t *grouplist) +asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist) { old_gid_t groups[NGROUPS]; int i,j; @@ -126,7 +126,7 @@ asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t *grouplist) return i; } -asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t *grouplist) +asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist) { old_gid_t groups[NGROUPS]; gid_t new_groups[NGROUPS]; |
