Commit 720cc7e3 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse alpha: trivial parts of __user annotation

Trivial stuff in arch/alpha annotated; in two cases of
osf_proplist_syscall() dereferencing userland pointers replaced with
get_user
parent 2d6ef4c5
...@@ -91,7 +91,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len, ...@@ -91,7 +91,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
* braindamage (it can't really handle filesystems where the directory * braindamage (it can't really handle filesystems where the directory
* offset differences aren't the same as "d_reclen"). * offset differences aren't the same as "d_reclen").
*/ */
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de))) #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
#define ROUND_UP(x) (((x)+3) & ~3) #define ROUND_UP(x) (((x)+3) & ~3)
struct osf_dirent { struct osf_dirent {
...@@ -102,8 +102,8 @@ struct osf_dirent { ...@@ -102,8 +102,8 @@ struct osf_dirent {
}; };
struct osf_dirent_callback { struct osf_dirent_callback {
struct osf_dirent *dirent; struct osf_dirent __user *dirent;
long *basep; long __user *basep;
unsigned int count; unsigned int count;
int error; int error;
}; };
...@@ -112,7 +112,7 @@ static int ...@@ -112,7 +112,7 @@ static int
osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
ino_t ino, unsigned int d_type) ino_t ino, unsigned int d_type)
{ {
struct osf_dirent *dirent; struct osf_dirent __user *dirent;
struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
...@@ -131,15 +131,15 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, ...@@ -131,15 +131,15 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
if (copy_to_user(dirent->d_name, name, namlen) || if (copy_to_user(dirent->d_name, name, namlen) ||
put_user(0, dirent->d_name + namlen)) put_user(0, dirent->d_name + namlen))
return -EFAULT; return -EFAULT;
dirent = (void *)dirent + reclen; dirent = (void __user *)dirent + reclen;
buf->dirent = dirent; buf->dirent = dirent;
buf->count -= reclen; buf->count -= reclen;
return 0; return 0;
} }
asmlinkage int asmlinkage int
osf_getdirentries(unsigned int fd, struct osf_dirent *dirent, osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent,
unsigned int count, long *basep) unsigned int count, long __user *basep)
{ {
int error; int error;
struct file *file; struct file *file;
...@@ -215,10 +215,10 @@ struct osf_statfs { ...@@ -215,10 +215,10 @@ struct osf_statfs {
int f_files; int f_files;
int f_ffree; int f_ffree;
__kernel_fsid_t f_fsid; __kernel_fsid_t f_fsid;
} *osf_stat; };
static int static int
linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs *osf_stat, linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs __user *osf_stat,
unsigned long bufsiz) unsigned long bufsiz)
{ {
struct osf_statfs tmp_stat; struct osf_statfs tmp_stat;
...@@ -239,7 +239,7 @@ linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs *osf_stat, ...@@ -239,7 +239,7 @@ linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs *osf_stat,
} }
static int static int
do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer, do_osf_statfs(struct dentry * dentry, struct osf_statfs __user *buffer,
unsigned long bufsiz) unsigned long bufsiz)
{ {
struct kstatfs linux_stat; struct kstatfs linux_stat;
...@@ -250,7 +250,7 @@ do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer, ...@@ -250,7 +250,7 @@ do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer,
} }
asmlinkage int asmlinkage int
osf_statfs(char *path, struct osf_statfs *buffer, unsigned long bufsiz) osf_statfs(char __user *path, struct osf_statfs __user *buffer, unsigned long bufsiz)
{ {
struct nameidata nd; struct nameidata nd;
int retval; int retval;
...@@ -264,7 +264,7 @@ osf_statfs(char *path, struct osf_statfs *buffer, unsigned long bufsiz) ...@@ -264,7 +264,7 @@ osf_statfs(char *path, struct osf_statfs *buffer, unsigned long bufsiz)
} }
asmlinkage int asmlinkage int
osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz) osf_fstatfs(unsigned long fd, struct osf_statfs __user *buffer, unsigned long bufsiz)
{ {
struct file *file; struct file *file;
int retval; int retval;
...@@ -284,13 +284,13 @@ osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz) ...@@ -284,13 +284,13 @@ osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz)
* Although to be frank, neither are the native Linux/i386 ones.. * Although to be frank, neither are the native Linux/i386 ones..
*/ */
struct ufs_args { struct ufs_args {
char *devname; char __user *devname;
int flags; int flags;
uid_t exroot; uid_t exroot;
}; };
struct cdfs_args { struct cdfs_args {
char *devname; char __user *devname;
int flags; int flags;
uid_t exroot; uid_t exroot;
...@@ -299,7 +299,7 @@ struct cdfs_args { ...@@ -299,7 +299,7 @@ struct cdfs_args {
}; };
struct procfs_args { struct procfs_args {
char *devname; char __user *devname;
int flags; int flags;
uid_t exroot; uid_t exroot;
}; };
...@@ -313,7 +313,7 @@ struct procfs_args { ...@@ -313,7 +313,7 @@ struct procfs_args {
* unhappy with OSF UFS. [CHECKME] * unhappy with OSF UFS. [CHECKME]
*/ */
static int static int
osf_ufs_mount(char *dirname, struct ufs_args *args, int flags) osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags)
{ {
int retval; int retval;
struct cdfs_args tmp; struct cdfs_args tmp;
...@@ -333,7 +333,7 @@ osf_ufs_mount(char *dirname, struct ufs_args *args, int flags) ...@@ -333,7 +333,7 @@ osf_ufs_mount(char *dirname, struct ufs_args *args, int flags)
} }
static int static int
osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags) osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags)
{ {
int retval; int retval;
struct cdfs_args tmp; struct cdfs_args tmp;
...@@ -353,7 +353,7 @@ osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags) ...@@ -353,7 +353,7 @@ osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags)
} }
static int static int
osf_procfs_mount(char *dirname, struct procfs_args *args, int flags) osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags)
{ {
struct procfs_args tmp; struct procfs_args tmp;
...@@ -364,7 +364,7 @@ osf_procfs_mount(char *dirname, struct procfs_args *args, int flags) ...@@ -364,7 +364,7 @@ osf_procfs_mount(char *dirname, struct procfs_args *args, int flags)
} }
asmlinkage int asmlinkage int
osf_mount(unsigned long typenr, char *path, int flag, void *data) osf_mount(unsigned long typenr, char __user *path, int flag, void __user *data)
{ {
int retval = -EINVAL; int retval = -EINVAL;
char *name; char *name;
...@@ -377,13 +377,13 @@ osf_mount(unsigned long typenr, char *path, int flag, void *data) ...@@ -377,13 +377,13 @@ osf_mount(unsigned long typenr, char *path, int flag, void *data)
goto out; goto out;
switch (typenr) { switch (typenr) {
case 1: case 1:
retval = osf_ufs_mount(name, (struct ufs_args *) data, flag); retval = osf_ufs_mount(name, data, flag);
break; break;
case 6: case 6:
retval = osf_cdfs_mount(name, (struct cdfs_args *) data, flag); retval = osf_cdfs_mount(name, data, flag);
break; break;
case 9: case 9:
retval = osf_procfs_mount(name, (struct procfs_args *) data, flag); retval = osf_procfs_mount(name, data, flag);
break; break;
default: default:
printk("osf_mount(%ld, %x)\n", typenr, flag); printk("osf_mount(%ld, %x)\n", typenr, flag);
...@@ -395,7 +395,7 @@ osf_mount(unsigned long typenr, char *path, int flag, void *data) ...@@ -395,7 +395,7 @@ osf_mount(unsigned long typenr, char *path, int flag, void *data)
} }
asmlinkage int asmlinkage int
osf_utsname(char *name) osf_utsname(char __user *name)
{ {
int error; int error;
...@@ -434,7 +434,7 @@ sys_getdtablesize(void) ...@@ -434,7 +434,7 @@ sys_getdtablesize(void)
* For compatibility with OSF/1 only. Use utsname(2) instead. * For compatibility with OSF/1 only. Use utsname(2) instead.
*/ */
asmlinkage int asmlinkage int
osf_getdomainname(char *name, int namelen) osf_getdomainname(char __user *name, int namelen)
{ {
unsigned len; unsigned len;
int i, error; int i, error;
...@@ -459,7 +459,7 @@ osf_getdomainname(char *name, int namelen) ...@@ -459,7 +459,7 @@ osf_getdomainname(char *name, int namelen)
} }
asmlinkage long asmlinkage long
osf_shmat(int shmid, void *shmaddr, int shmflg) osf_shmat(int shmid, void __user *shmaddr, int shmflg)
{ {
unsigned long raddr; unsigned long raddr;
long err; long err;
...@@ -497,39 +497,39 @@ struct proplistname_args { ...@@ -497,39 +497,39 @@ struct proplistname_args {
union pl_args { union pl_args {
struct setargs { struct setargs {
char *path; char __user *path;
long follow; long follow;
long nbytes; long nbytes;
char *buf; char __user *buf;
} set; } set;
struct fsetargs { struct fsetargs {
long fd; long fd;
long nbytes; long nbytes;
char *buf; char __user *buf;
} fset; } fset;
struct getargs { struct getargs {
char *path; char __user *path;
long follow; long follow;
struct proplistname_args *name_args; struct proplistname_args __user *name_args;
long nbytes; long nbytes;
char *buf; char __user *buf;
int *min_buf_size; int __user *min_buf_size;
} get; } get;
struct fgetargs { struct fgetargs {
long fd; long fd;
struct proplistname_args *name_args; struct proplistname_args __user *name_args;
long nbytes; long nbytes;
char *buf; char __user *buf;
int *min_buf_size; int __user *min_buf_size;
} fget; } fget;
struct delargs { struct delargs {
char *path; char __user *path;
long follow; long follow;
struct proplistname_args *name_args; struct proplistname_args __user *name_args;
} del; } del;
struct fdelargs { struct fdelargs {
long fd; long fd;
struct proplistname_args *name_args; struct proplistname_args __user *name_args;
} fdel; } fdel;
}; };
...@@ -540,24 +540,20 @@ enum pl_code { ...@@ -540,24 +540,20 @@ enum pl_code {
}; };
asmlinkage long asmlinkage long
osf_proplist_syscall(enum pl_code code, union pl_args *args) osf_proplist_syscall(enum pl_code code, union pl_args __user *args)
{ {
long error; long error;
int *min_buf_size_ptr; int __user *min_buf_size_ptr;
lock_kernel(); lock_kernel();
switch (code) { switch (code) {
case PL_SET: case PL_SET:
error = verify_area(VERIFY_READ, &args->set.nbytes, if (get_user(error, &args->set.nbytes))
sizeof(args->set.nbytes)); error = -EFAULT;
if (!error)
error = args->set.nbytes;
break; break;
case PL_FSET: case PL_FSET:
error = verify_area(VERIFY_READ, &args->fset.nbytes, if (get_user(error, &args->fset.nbytes))
sizeof(args->fset.nbytes)); error = -EFAULT;
if (!error)
error = args->fset.nbytes;
break; break;
case PL_GET: case PL_GET:
error = get_user(min_buf_size_ptr, &args->get.min_buf_size); error = get_user(min_buf_size_ptr, &args->get.min_buf_size);
...@@ -584,7 +580,7 @@ osf_proplist_syscall(enum pl_code code, union pl_args *args) ...@@ -584,7 +580,7 @@ osf_proplist_syscall(enum pl_code code, union pl_args *args)
} }
asmlinkage int asmlinkage int
osf_sigstack(struct sigstack *uss, struct sigstack *uoss) osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
{ {
unsigned long usp = rdusp(); unsigned long usp = rdusp();
unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size; unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size;
...@@ -625,7 +621,7 @@ osf_sigstack(struct sigstack *uss, struct sigstack *uoss) ...@@ -625,7 +621,7 @@ osf_sigstack(struct sigstack *uss, struct sigstack *uoss)
} }
asmlinkage long asmlinkage long
osf_sysinfo(int command, char *buf, long count) osf_sysinfo(int command, char __user *buf, long count)
{ {
static char * sysinfo_table[] = { static char * sysinfo_table[] = {
system_utsname.sysname, system_utsname.sysname,
...@@ -664,8 +660,8 @@ osf_sysinfo(int command, char *buf, long count) ...@@ -664,8 +660,8 @@ osf_sysinfo(int command, char *buf, long count)
} }
asmlinkage unsigned long asmlinkage unsigned long
osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes, osf_getsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
int *start, void *arg) int __user *start, void __user *arg)
{ {
unsigned long w; unsigned long w;
struct percpu_struct *cpu; struct percpu_struct *cpu;
...@@ -677,7 +673,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes, ...@@ -677,7 +673,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
w = current_thread_info()->ieee_state & IEEE_SW_MASK; w = current_thread_info()->ieee_state & IEEE_SW_MASK;
w = swcr_update_status(w, rdfpcr()); w = swcr_update_status(w, rdfpcr());
if (put_user(w, (unsigned long *) buffer)) if (put_user(w, (unsigned long __user *) buffer))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -693,7 +689,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes, ...@@ -693,7 +689,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
if (nbytes < sizeof(unsigned int)) if (nbytes < sizeof(unsigned int))
return -EINVAL; return -EINVAL;
w = (current_thread_info()->flags >> UAC_SHIFT) & UAC_BITMASK; w = (current_thread_info()->flags >> UAC_SHIFT) & UAC_BITMASK;
if (put_user(w, (unsigned int *)buffer)) if (put_user(w, (unsigned int __user *)buffer))
return -EFAULT; return -EFAULT;
return 1; return 1;
...@@ -703,7 +699,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes, ...@@ -703,7 +699,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
cpu = (struct percpu_struct*) cpu = (struct percpu_struct*)
((char*)hwrpb + hwrpb->processor_offset); ((char*)hwrpb + hwrpb->processor_offset);
w = cpu->type; w = cpu->type;
if (put_user(w, (unsigned long *)buffer)) if (put_user(w, (unsigned long __user*)buffer))
return -EFAULT; return -EFAULT;
return 1; return 1;
...@@ -722,8 +718,8 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes, ...@@ -722,8 +718,8 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
} }
asmlinkage unsigned long asmlinkage unsigned long
osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes, osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
int *start, void *arg) int __user *start, void __user *arg)
{ {
switch (op) { switch (op) {
case SSI_IEEE_FP_CONTROL: { case SSI_IEEE_FP_CONTROL: {
...@@ -737,7 +733,7 @@ osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes, ...@@ -737,7 +733,7 @@ osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
*/ */
/* Update softare trap enable bits. */ /* Update softare trap enable bits. */
if (get_user(swcr, (unsigned long *)buffer)) if (get_user(swcr, (unsigned long __user *)buffer))
return -EFAULT; return -EFAULT;
current_thread_info()->ieee_state current_thread_info()->ieee_state
= ((current_thread_info()->ieee_state & ~IEEE_SW_MASK) = ((current_thread_info()->ieee_state & ~IEEE_SW_MASK)
...@@ -788,9 +784,9 @@ osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes, ...@@ -788,9 +784,9 @@ osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
for (i = 0; i < nbytes; ++i) { for (i = 0; i < nbytes; ++i) {
if (get_user(v, 2*i + (unsigned int *)buffer)) if (get_user(v, 2*i + (unsigned int __user *)buffer))
return -EFAULT; return -EFAULT;
if (get_user(w, 2*i + 1 + (unsigned int *)buffer)) if (get_user(w, 2*i + 1 + (unsigned int __user *)buffer))
return -EFAULT; return -EFAULT;
switch (v) { switch (v) {
case SSIN_UACPROC: case SSIN_UACPROC:
...@@ -835,7 +831,7 @@ struct itimerval32 ...@@ -835,7 +831,7 @@ struct itimerval32
}; };
static inline long static inline long
get_tv32(struct timeval *o, struct timeval32 *i) get_tv32(struct timeval *o, struct timeval32 __user *i)
{ {
return (!access_ok(VERIFY_READ, i, sizeof(*i)) || return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
(__get_user(o->tv_sec, &i->tv_sec) | (__get_user(o->tv_sec, &i->tv_sec) |
...@@ -843,7 +839,7 @@ get_tv32(struct timeval *o, struct timeval32 *i) ...@@ -843,7 +839,7 @@ get_tv32(struct timeval *o, struct timeval32 *i)
} }
static inline long static inline long
put_tv32(struct timeval32 *o, struct timeval *i) put_tv32(struct timeval32 __user *o, struct timeval *i)
{ {
return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
(__put_user(i->tv_sec, &o->tv_sec) | (__put_user(i->tv_sec, &o->tv_sec) |
...@@ -851,7 +847,7 @@ put_tv32(struct timeval32 *o, struct timeval *i) ...@@ -851,7 +847,7 @@ put_tv32(struct timeval32 *o, struct timeval *i)
} }
static inline long static inline long
get_it32(struct itimerval *o, struct itimerval32 *i) get_it32(struct itimerval *o, struct itimerval32 __user *i)
{ {
return (!access_ok(VERIFY_READ, i, sizeof(*i)) || return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
(__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) | (__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) |
...@@ -861,7 +857,7 @@ get_it32(struct itimerval *o, struct itimerval32 *i) ...@@ -861,7 +857,7 @@ get_it32(struct itimerval *o, struct itimerval32 *i)
} }
static inline long static inline long
put_it32(struct itimerval32 *o, struct itimerval *i) put_it32(struct itimerval32 __user *o, struct itimerval *i)
{ {
return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
(__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) | (__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) |
...@@ -878,7 +874,7 @@ jiffies_to_timeval32(unsigned long jiffies, struct timeval32 *value) ...@@ -878,7 +874,7 @@ jiffies_to_timeval32(unsigned long jiffies, struct timeval32 *value)
} }
asmlinkage int asmlinkage int
osf_gettimeofday(struct timeval32 *tv, struct timezone *tz) osf_gettimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
{ {
if (tv) { if (tv) {
struct timeval ktv; struct timeval ktv;
...@@ -894,7 +890,7 @@ osf_gettimeofday(struct timeval32 *tv, struct timezone *tz) ...@@ -894,7 +890,7 @@ osf_gettimeofday(struct timeval32 *tv, struct timezone *tz)
} }
asmlinkage int asmlinkage int
osf_settimeofday(struct timeval32 *tv, struct timezone *tz) osf_settimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
{ {
struct timespec kts; struct timespec kts;
struct timezone ktz; struct timezone ktz;
...@@ -914,7 +910,7 @@ osf_settimeofday(struct timeval32 *tv, struct timezone *tz) ...@@ -914,7 +910,7 @@ osf_settimeofday(struct timeval32 *tv, struct timezone *tz)
} }
asmlinkage int asmlinkage int
osf_getitimer(int which, struct itimerval32 *it) osf_getitimer(int which, struct itimerval32 __user *it)
{ {
struct itimerval kit; struct itimerval kit;
int error; int error;
...@@ -927,7 +923,7 @@ osf_getitimer(int which, struct itimerval32 *it) ...@@ -927,7 +923,7 @@ osf_getitimer(int which, struct itimerval32 *it)
} }
asmlinkage int asmlinkage int
osf_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out) osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __user *out)
{ {
struct itimerval kin, kout; struct itimerval kin, kout;
int error; int error;
...@@ -950,7 +946,7 @@ osf_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out) ...@@ -950,7 +946,7 @@ osf_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out)
} }
asmlinkage int asmlinkage int
osf_utimes(const char *filename, struct timeval32 *tvs) osf_utimes(char __user *filename, struct timeval32 __user *tvs)
{ {
char *kfilename; char *kfilename;
struct timeval ktvs[2]; struct timeval ktvs[2];
...@@ -981,8 +977,8 @@ osf_utimes(const char *filename, struct timeval32 *tvs) ...@@ -981,8 +977,8 @@ osf_utimes(const char *filename, struct timeval32 *tvs)
((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1) ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
asmlinkage int asmlinkage int
osf_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
struct timeval32 *tvp) struct timeval32 __user *tvp)
{ {
fd_set_bits fds; fd_set_bits fds;
char *bits; char *bits;
...@@ -1081,7 +1077,7 @@ struct rusage32 { ...@@ -1081,7 +1077,7 @@ struct rusage32 {
}; };
asmlinkage int asmlinkage int
osf_getrusage(int who, struct rusage32 *ru) osf_getrusage(int who, struct rusage32 __user *ru)
{ {
struct rusage32 r; struct rusage32 r;
...@@ -1116,7 +1112,7 @@ osf_getrusage(int who, struct rusage32 *ru) ...@@ -1116,7 +1112,7 @@ osf_getrusage(int who, struct rusage32 *ru)
} }
asmlinkage int asmlinkage int
osf_wait4(pid_t pid, int *ustatus, int options, struct rusage32 *ur) osf_wait4(pid_t pid, int __user *ustatus, int options, struct rusage32 __user *ur)
{ {
if (!ur) { if (!ur) {
return sys_wait4(pid, ustatus, options, NULL); return sys_wait4(pid, ustatus, options, NULL);
...@@ -1163,7 +1159,7 @@ osf_wait4(pid_t pid, int *ustatus, int options, struct rusage32 *ur) ...@@ -1163,7 +1159,7 @@ osf_wait4(pid_t pid, int *ustatus, int options, struct rusage32 *ur)
* one is the time remaining.. Ho humm.. No documentation. * one is the time remaining.. Ho humm.. No documentation.
*/ */
asmlinkage int asmlinkage int
osf_usleep_thread(struct timeval32 *sleep, struct timeval32 *remain) osf_usleep_thread(struct timeval32 __user *sleep, struct timeval32 __user *remain)
{ {
struct timeval tmp; struct timeval tmp;
unsigned long ticks; unsigned long ticks;
...@@ -1221,7 +1217,7 @@ struct timex32 { ...@@ -1221,7 +1217,7 @@ struct timex32 {
}; };
asmlinkage int asmlinkage int
sys_old_adjtimex(struct timex32 *txc_p) sys_old_adjtimex(struct timex32 __user *txc_p)
{ {
struct timex txc; struct timex txc;
int ret; int ret;
...@@ -1316,12 +1312,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, ...@@ -1316,12 +1312,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
compatibility with old versions of OSF/1 where iov_len compatibility with old versions of OSF/1 where iov_len
was defined as int. */ was defined as int. */
static int static int
osf_fix_iov_len(const struct iovec *iov, unsigned long count) osf_fix_iov_len(const struct iovec __user *iov, unsigned long count)
{ {
unsigned long i; unsigned long i;
for (i = 0 ; i < count ; i++) { for (i = 0 ; i < count ; i++) {
int *iov_len_high = (int *)&iov[i].iov_len + 1; int *iov_len_high = (int __user *)&iov[i].iov_len + 1;
if (put_user(0, iov_len_high)) if (put_user(0, iov_len_high))
return -EFAULT; return -EFAULT;
...@@ -1330,7 +1326,7 @@ osf_fix_iov_len(const struct iovec *iov, unsigned long count) ...@@ -1330,7 +1326,7 @@ osf_fix_iov_len(const struct iovec *iov, unsigned long count)
} }
asmlinkage ssize_t asmlinkage ssize_t
osf_readv(unsigned long fd, const struct iovec * vector, unsigned long count) osf_readv(unsigned long fd, const struct iovec __user * vector, unsigned long count)
{ {
if (unlikely(personality(current->personality) == PER_OSF4)) if (unlikely(personality(current->personality) == PER_OSF4))
if (osf_fix_iov_len(vector, count)) if (osf_fix_iov_len(vector, count))
...@@ -1339,7 +1335,7 @@ osf_readv(unsigned long fd, const struct iovec * vector, unsigned long count) ...@@ -1339,7 +1335,7 @@ osf_readv(unsigned long fd, const struct iovec * vector, unsigned long count)
} }
asmlinkage ssize_t asmlinkage ssize_t
osf_writev(unsigned long fd, const struct iovec * vector, unsigned long count) osf_writev(unsigned long fd, const struct iovec __user * vector, unsigned long count)
{ {
if (unlikely(personality(current->personality) == PER_OSF4)) if (unlikely(personality(current->personality) == PER_OSF4))
if (osf_fix_iov_len(vector, count)) if (osf_fix_iov_len(vector, count))
......
...@@ -239,8 +239,9 @@ release_thread(struct task_struct *dead_task) ...@@ -239,8 +239,9 @@ release_thread(struct task_struct *dead_task)
* with parameters (SIGCHLD, 0). * with parameters (SIGCHLD, 0).
*/ */
int int
alpha_clone(unsigned long clone_flags, unsigned long usp, int *parent_tid, alpha_clone(unsigned long clone_flags, unsigned long usp,
int *child_tid, unsigned long tls_value, struct pt_regs *regs) int __user *parent_tid, int __user *child_tid,
unsigned long tls_value, struct pt_regs *regs)
{ {
if (!usp) if (!usp)
usp = rdusp(); usp = rdusp();
...@@ -464,7 +465,8 @@ dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task) ...@@ -464,7 +465,8 @@ dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
* Don't do this at home. * Don't do this at home.
*/ */
asmlinkage int asmlinkage int
sys_execve(char *ufilename, char **argv, char **envp, sys_execve(char __user *ufilename, char __user * __user *argv,
char __user * __user *envp,
unsigned long a3, unsigned long a4, unsigned long a5, unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs regs) struct pt_regs regs)
{ {
......
...@@ -84,8 +84,8 @@ osf_sigprocmask(int how, unsigned long newmask, long a2, long a3, ...@@ -84,8 +84,8 @@ osf_sigprocmask(int how, unsigned long newmask, long a2, long a3,
} }
asmlinkage int asmlinkage int
osf_sigaction(int sig, const struct osf_sigaction *act, osf_sigaction(int sig, const struct osf_sigaction __user *act,
struct osf_sigaction *oact) struct osf_sigaction __user *oact)
{ {
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;
...@@ -115,8 +115,9 @@ osf_sigaction(int sig, const struct osf_sigaction *act, ...@@ -115,8 +115,9 @@ osf_sigaction(int sig, const struct osf_sigaction *act,
} }
asmlinkage long asmlinkage long
sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact, sys_rt_sigaction(int sig, const struct sigaction __user *act,
size_t sigsetsize, void *restorer) struct sigaction __user *oact,
size_t sigsetsize, void __user *restorer)
{ {
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;
...@@ -165,7 +166,7 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *reg, struct switch_stack *sw) ...@@ -165,7 +166,7 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *reg, struct switch_stack *sw)
} }
asmlinkage int asmlinkage int
do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize, do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
struct pt_regs *reg, struct switch_stack *sw) struct pt_regs *reg, struct switch_stack *sw)
{ {
sigset_t oldset, set; sigset_t oldset, set;
...@@ -192,7 +193,7 @@ do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize, ...@@ -192,7 +193,7 @@ do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize,
} }
asmlinkage int asmlinkage int
sys_sigaltstack(const stack_t *uss, stack_t *uoss) sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
{ {
return do_sigaltstack(uss, uoss, rdusp()); return do_sigaltstack(uss, uoss, rdusp());
} }
...@@ -223,7 +224,7 @@ struct rt_sigframe ...@@ -223,7 +224,7 @@ struct rt_sigframe
#define INSN_CALLSYS 0x00000083 #define INSN_CALLSYS 0x00000083
static long static long
restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs, restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
struct switch_stack *sw) struct switch_stack *sw)
{ {
unsigned long usp; unsigned long usp;
...@@ -276,7 +277,7 @@ restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs, ...@@ -276,7 +277,7 @@ restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
registers and transfer control from userland. */ registers and transfer control from userland. */
asmlinkage void asmlinkage void
do_sigreturn(struct sigcontext *sc, struct pt_regs *regs, do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
struct switch_stack *sw) struct switch_stack *sw)
{ {
sigset_t set; sigset_t set;
...@@ -314,7 +315,7 @@ do_sigreturn(struct sigcontext *sc, struct pt_regs *regs, ...@@ -314,7 +315,7 @@ do_sigreturn(struct sigcontext *sc, struct pt_regs *regs,
} }
asmlinkage void asmlinkage void
do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs, do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
struct switch_stack *sw) struct switch_stack *sw)
{ {
sigset_t set; sigset_t set;
...@@ -356,17 +357,17 @@ do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs, ...@@ -356,17 +357,17 @@ do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs,
* Set up a signal frame. * Set up a signal frame.
*/ */
static inline void * static inline void __user *
get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
{ {
if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp))
sp = current->sas_ss_sp + current->sas_ss_size; sp = current->sas_ss_sp + current->sas_ss_size;
return (void *)((sp - frame_size) & -32ul); return (void __user *)((sp - frame_size) & -32ul);
} }
static long static long
setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
struct switch_stack *sw, unsigned long mask, unsigned long sp) struct switch_stack *sw, unsigned long mask, unsigned long sp)
{ {
long i, err = 0; long i, err = 0;
...@@ -426,7 +427,7 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, ...@@ -426,7 +427,7 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
struct pt_regs *regs, struct switch_stack * sw) struct pt_regs *regs, struct switch_stack * sw)
{ {
unsigned long oldsp, r26, err = 0; unsigned long oldsp, r26, err = 0;
struct sigframe *frame; struct sigframe __user *frame;
oldsp = rdusp(); oldsp = rdusp();
frame = get_sigframe(ka, oldsp, sizeof(*frame)); frame = get_sigframe(ka, oldsp, sizeof(*frame));
...@@ -479,7 +480,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -479,7 +480,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs, struct switch_stack * sw) sigset_t *set, struct pt_regs *regs, struct switch_stack * sw)
{ {
unsigned long oldsp, r26, err = 0; unsigned long oldsp, r26, err = 0;
struct rt_sigframe *frame; struct rt_sigframe __user *frame;
oldsp = rdusp(); oldsp = rdusp();
frame = get_sigframe(ka, oldsp, sizeof(*frame)); frame = get_sigframe(ka, oldsp, sizeof(*frame));
......
...@@ -106,7 +106,7 @@ alpha_fp_emul (unsigned long pc) ...@@ -106,7 +106,7 @@ alpha_fp_emul (unsigned long pc)
__u32 insn; __u32 insn;
long si_code; long si_code;
get_user(insn, (__u32*)pc); get_user(insn, (__u32 __user *)pc);
fc = (insn >> 0) & 0x1f; /* destination register */ fc = (insn >> 0) & 0x1f; /* destination register */
fb = (insn >> 16) & 0x1f; fb = (insn >> 16) & 0x1f;
fa = (insn >> 21) & 0x1f; fa = (insn >> 21) & 0x1f;
...@@ -351,7 +351,7 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask) ...@@ -351,7 +351,7 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask)
* up to the first occurrence of such an instruction. * up to the first occurrence of such an instruction.
*/ */
while (write_mask) { while (write_mask) {
get_user(insn, (__u32*)(trigger_pc)); get_user(insn, (__u32 __user *)(trigger_pc));
opcode = insn >> 26; opcode = insn >> 26;
rc = insn & 0x1f; rc = insn & 0x1f;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment