struct task_struct *p;
char tcomm[sizeof(current->comm)];
- retval = verify_area(VERIFY_WRITE, buf, sizeof(tcomm));
- if (retval)
+ if (!access_ok(VERIFY_WRITE, buf, sizeof(tcomm))) {
+ retval = -EFAULT;
break;
+ }
read_lock(&tasklist_lock);
p = find_task_by_pid(pid);
if (!p) {
char *buf = (char *) regs->regs[base+6];
char *value;
return -EINVAL; /* til I fix it */
- retval = verify_area(VERIFY_WRITE, buf, 128);
- if (retval)
+ if (!access_ok(VERIFY_WRITE, buf, 128)) {
+ retval = -EFAULT;
break;
+ }
value = prom_getenv(name); /* PROM lock? */
if (!value) {
retval = -EINVAL;
pmd_t *pmdp;
pte_t *ptep;
- retval = verify_area(VERIFY_WRITE, pageno, sizeof(int));
- if (retval)
- return retval;
+ if (!access_ok(VERIFY_WRITE, pageno, sizeof(int)))
+ return -EFAULT;
down_read(&mm->mmap_sem);
pgdp = pgd_offset(mm, addr);
error = -EINVAL;
goto out;
}
- error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statfs));
- if (error)
+ if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statfs))) {
+ error = -EFAULT;
goto out;
+ }
error = user_path_walk(path, &nd);
if (error)
goto out;
struct file *file;
int error, i;
- error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statfs));
- if (error)
+ if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statfs))) {
+ error = -EFAULT;
goto out;
+ }
if (!(file = fget(fd))) {
error = -EBADF;
goto out;
int err = 0;
if (tbuf) {
- err = verify_area(VERIFY_WRITE,tbuf,sizeof *tbuf);
- if (err)
- return err;
+ if (!access_ok(VERIFY_WRITE,tbuf,sizeof *tbuf))
+ return -EFAULT;
err |= __put_user(current->utime, &tbuf->tms_utime);
err |= __put_user(current->stime, &tbuf->tms_stime);
err |= __put_user(current->signal->cutime, &tbuf->tms_cutime);
{
int error;
- error = verify_area(VERIFY_WRITE, name, len);
- if (error)
- return error;
+ if (!access_ok(VERIFY_WRITE, name, len))
+ return -EFAULT;
down_read(&uts_sem);
if (len > __NEW_UTS_LEN)
long nsec, seq;
int err;
- if (verify_area(VERIFY_WRITE, tv, sizeof(struct timeval)))
+ if (!access_ok(VERIFY_WRITE, tv, sizeof(struct timeval)))
return -EFAULT;
do {
printk("[%s:%d] Wheee.. irix_statvfs(%s,%p)\n",
current->comm, current->pid, fname, buf);
- error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
- if (error)
+ if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs))) {
+ error = -EFAULT;
goto out;
+ }
error = user_path_walk(fname, &nd);
if (error)
goto out;
printk("[%s:%d] Wheee.. irix_fstatvfs(%d,%p)\n",
current->comm, current->pid, fd, buf);
- error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
- if (error)
+ if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs))) {
+ error = -EFAULT;
goto out;
+ }
if (!(file = fget(fd))) {
error = -EBADF;
goto out;
prot = regs->regs[base + 6];
if (!base) {
flags = regs->regs[base + 7];
- error = verify_area(VERIFY_READ, sp, (4 * sizeof(unsigned long)));
- if(error)
+ if (!access_ok(VERIFY_READ, sp, (4 * sizeof(unsigned long)))) {
+ error = -EFAULT;
goto out;
+ }
fd = sp[0];
__get_user(off1, &sp[1]);
__get_user(off2, &sp[2]);
} else {
- error = verify_area(VERIFY_READ, sp, (5 * sizeof(unsigned long)));
- if(error)
+ if (!access_ok(VERIFY_READ, sp, (5 * sizeof(unsigned long)))) {
+ error = -EFAULT;
goto out;
+ }
__get_user(flags, &sp[0]);
__get_user(fd, &sp[1]);
__get_user(off1, &sp[2]);
printk("[%s:%d] Wheee.. irix_statvfs64(%s,%p)\n",
current->comm, current->pid, fname, buf);
- error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs64));
- if(error)
+ if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs64))) {
+ error = -EFAULT;
goto out;
+ }
error = user_path_walk(fname, &nd);
if (error)
goto out;
printk("[%s:%d] Wheee.. irix_fstatvfs64(%d,%p)\n",
current->comm, current->pid, fd, buf);
- error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
- if (error)
+ if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs))) {
+ error = -EFAULT;
goto out;
+ }
if (!(file = fget(fd))) {
error = -EBADF;
goto out;
asmlinkage int irix_getmountid(char *fname, unsigned long *midbuf)
{
- int err;
+ int err = 0;
printk("[%s:%d] irix_getmountid(%s, %p)\n",
current->comm, current->pid, fname, midbuf);
- err = verify_area(VERIFY_WRITE, midbuf, (sizeof(unsigned long) * 4));
- if (err)
- return err;
+ if (!access_ok(VERIFY_WRITE, midbuf, (sizeof(unsigned long) * 4)))
+ return -EFAULT;
/*
* The idea with this system call is that when trying to determine