[PATCH][9/10] verify_area cleanup : misc remaining archs

From: Jesper Juhl
Date: Thu Mar 03 2005 - 22:42:10 EST



The last remaining archs that have not already been converted from
verify_area to access_ok by the previous patches are all taken care of by
this one.


Signed-off-by: Jesper Juhl <juhl-lkml@xxxxxx>

diff -urp linux-2.6.11-orig/arch/sh/kernel/signal.c linux-2.6.11/arch/sh/kernel/signal.c
--- linux-2.6.11-orig/arch/sh/kernel/signal.c 2005-03-02 08:38:34.000000000 +0100
+++ linux-2.6.11/arch/sh/kernel/signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -100,7 +100,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -112,7 +112,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -239,7 +239,7 @@ asmlinkage int sys_sigreturn(unsigned lo
sigset_t set;
int r0;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;

if (__get_user(set.sig[0], &frame->sc.oldmask)
@@ -273,7 +273,7 @@ asmlinkage int sys_rt_sigreturn(unsigned
stack_t st;
int r0;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;

if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
diff -urp linux-2.6.11-orig/arch/um/include/sysdep-i386/checksum.h linux-2.6.11/arch/um/include/sysdep-i386/checksum.h
--- linux-2.6.11-orig/arch/um/include/sysdep-i386/checksum.h 2005-03-02 08:38:34.000000000 +0100
+++ linux-2.6.11/arch/um/include/sysdep-i386/checksum.h 2005-03-03 22:28:34.000000000 +0100
@@ -41,7 +41,7 @@ unsigned int csum_partial_copy_from(cons
* passed in an incorrect kernel address to one of these functions.
*
* If you use these functions directly please don't forget the
- * verify_area().
+ * access_ok().
*/

static __inline__
diff -urp linux-2.6.11-orig/arch/um/include/sysdep-x86_64/checksum.h linux-2.6.11/arch/um/include/sysdep-x86_64/checksum.h
--- linux-2.6.11-orig/arch/um/include/sysdep-x86_64/checksum.h 2005-03-02 08:37:54.000000000 +0100
+++ linux-2.6.11/arch/um/include/sysdep-x86_64/checksum.h 2005-03-03 22:28:34.000000000 +0100
@@ -19,7 +19,7 @@ extern unsigned csum_partial(const unsig
* passed in an incorrect kernel address to one of these functions.
*
* If you use these functions directly please don't forget the
- * verify_area().
+ * access_ok().
*/

static __inline__
diff -urp linux-2.6.11-orig/arch/um/sys-i386/ldt.c linux-2.6.11/arch/um/sys-i386/ldt.c
--- linux-2.6.11-orig/arch/um/sys-i386/ldt.c 2005-03-02 08:38:09.000000000 +0100
+++ linux-2.6.11/arch/um/sys-i386/ldt.c 2005-03-03 22:28:34.000000000 +0100
@@ -17,7 +17,7 @@ extern int modify_ldt(int func, void *pt

int sys_modify_ldt_tt(int func, void __user *ptr, unsigned long bytecount)
{
- if (verify_area(VERIFY_READ, ptr, bytecount))
+ if (!access_ok(VERIFY_READ, ptr, bytecount))
return -EFAULT;

return modify_ldt(func, ptr, bytecount);
diff -urp linux-2.6.11-orig/arch/um/sys-i386/signal.c linux-2.6.11/arch/um/sys-i386/signal.c
--- linux-2.6.11-orig/arch/um/sys-i386/signal.c 2005-03-02 08:38:17.000000000 +0100
+++ linux-2.6.11/arch/um/sys-i386/signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -211,8 +211,8 @@ int setup_signal_stack_sc(unsigned long

stack_top &= -8UL;
frame = (struct sigframe *) stack_top - 1;
- if(verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
- return(1);
+ if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
+ return 1;

restorer = (void *) frame->retcode;
if(ka->sa.sa_flags & SA_RESTORER)
@@ -261,8 +261,8 @@ int setup_signal_stack_si(unsigned long

stack_top &= -8UL;
frame = (struct rt_sigframe *) stack_top - 1;
- if(verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
- return(1);
+ if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
+ return 1;

restorer = (void *) frame->retcode;
if(ka->sa.sa_flags & SA_RESTORER)
diff -urp linux-2.6.11-orig/arch/um/sys-i386/syscalls.c linux-2.6.11/arch/um/sys-i386/syscalls.c
--- linux-2.6.11-orig/arch/um/sys-i386/syscalls.c 2005-03-02 08:38:09.000000000 +0100
+++ linux-2.6.11/arch/um/sys-i386/syscalls.c 2005-03-03 22:28:34.000000000 +0100
@@ -175,7 +175,7 @@ long sys_sigaction(int sig, const struct

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -187,7 +187,7 @@ long sys_sigaction(int sig, const struct
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
diff -urp linux-2.6.11-orig/arch/um/sys-x86_64/syscalls.c linux-2.6.11/arch/um/sys-x86_64/syscalls.c
--- linux-2.6.11-orig/arch/um/sys-x86_64/syscalls.c 2005-03-02 08:38:37.000000000 +0100
+++ linux-2.6.11/arch/um/sys-x86_64/syscalls.c 2005-03-03 22:28:34.000000000 +0100
@@ -29,8 +29,8 @@ long sys_modify_ldt_tt(int func, void *p
/* XXX This should check VERIFY_WRITE depending on func, check this
* in i386 as well.
*/
- if(verify_area(VERIFY_READ, ptr, bytecount))
- return(-EFAULT);
+ if (!access_ok(VERIFY_READ, ptr, bytecount))
+ return -EFAULT;
return(modify_ldt(func, ptr, bytecount));
}
#endif
diff -urp linux-2.6.11-orig/arch/arm/kernel/signal.c linux-2.6.11/arch/arm/kernel/signal.c
--- linux-2.6.11-orig/arch/arm/kernel/signal.c 2005-03-02 08:37:31.000000000 +0100
+++ linux-2.6.11/arch/arm/kernel/signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -102,7 +102,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -114,7 +114,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -317,7 +317,7 @@ asmlinkage int sys_sigreturn(struct pt_r

frame = (struct sigframe __user *)regs->ARM_sp;

- if (verify_area(VERIFY_READ, frame, sizeof (*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
goto badframe;
if (__get_user(set.sig[0], &frame->sc.oldmask)
|| (_NSIG_WORDS > 1
@@ -365,7 +365,7 @@ asmlinkage int sys_rt_sigreturn(struct p

frame = (struct rt_sigframe __user *)regs->ARM_sp;

- if (verify_area(VERIFY_READ, frame, sizeof (*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
goto badframe;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;
diff -urp linux-2.6.11-orig/arch/frv/kernel/signal.c linux-2.6.11/arch/frv/kernel/signal.c
--- linux-2.6.11-orig/arch/frv/kernel/signal.c 2005-03-02 08:38:33.000000000 +0100
+++ linux-2.6.11/arch/frv/kernel/signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -114,7 +114,7 @@ asmlinkage int sys_sigaction(int sig,

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -126,7 +126,7 @@ asmlinkage int sys_sigaction(int sig,
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -197,7 +197,7 @@ asmlinkage int sys_sigreturn(void)
sigset_t set;
int gr8;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__get_user(set.sig[0], &frame->sc.sc_oldmask))
goto badframe;
@@ -228,7 +228,7 @@ asmlinkage int sys_rt_sigreturn(void)
stack_t st;
int gr8;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;
diff -urp linux-2.6.11-orig/arch/parisc/kernel/sys_parisc32.c linux-2.6.11/arch/parisc/kernel/sys_parisc32.c
--- linux-2.6.11-orig/arch/parisc/kernel/sys_parisc32.c 2005-03-02 08:37:55.000000000 +0100
+++ linux-2.6.11/arch/parisc/kernel/sys_parisc32.c 2005-03-03 22:28:34.000000000 +0100
@@ -422,7 +422,7 @@ get_fd_set32(unsigned long n, u32 *ufdse
if (ufdset) {
unsigned long odd;

- if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32)))
+ if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32)))
return -EFAULT;

odd = n & 1UL;
Only in linux-2.6.11/arch/parisc/kernel: sys_parisc32.c~
diff -urp linux-2.6.11-orig/arch/cris/arch-v10/drivers/eeprom.c linux-2.6.11/arch/cris/arch-v10/drivers/eeprom.c
--- linux-2.6.11-orig/arch/cris/arch-v10/drivers/eeprom.c 2005-03-02 08:38:03.000000000 +0100
+++ linux-2.6.11/arch/cris/arch-v10/drivers/eeprom.c 2005-03-03 22:28:34.000000000 +0100
@@ -599,7 +599,7 @@ static ssize_t eeprom_write(struct file
int i, written, restart=1;
unsigned long p;

- if (verify_area(VERIFY_READ, buf, count))
+ if (!access_ok(VERIFY_READ, buf, count))
{
return -EFAULT;
}
diff -urp linux-2.6.11-orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.11/arch/cris/arch-v10/drivers/gpio.c
--- linux-2.6.11-orig/arch/cris/arch-v10/drivers/gpio.c 2005-03-02 08:38:34.000000000 +0100
+++ linux-2.6.11/arch/cris/arch-v10/drivers/gpio.c 2005-03-03 22:28:34.000000000 +0100
@@ -355,7 +355,7 @@ static ssize_t gpio_write(struct file *
return -EFAULT;
}

- if (verify_area(VERIFY_READ, buf, count)) {
+ if (!access_ok(VERIFY_READ, buf, count)) {
return -EFAULT;
}
clk_mask = priv->clk_mask;
diff -urp linux-2.6.11-orig/arch/cris/arch-v10/kernel/signal.c linux-2.6.11/arch/cris/arch-v10/kernel/signal.c
--- linux-2.6.11-orig/arch/cris/arch-v10/kernel/signal.c 2005-03-02 08:37:47.000000000 +0100
+++ linux-2.6.11/arch/cris/arch-v10/kernel/signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -125,7 +125,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -137,7 +137,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -231,7 +231,7 @@ asmlinkage int sys_sigreturn(long r10, l
if (((long)frame) & 3)
goto badframe;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__get_user(set.sig[0], &frame->sc.oldmask)
|| (_NSIG_WORDS > 1
@@ -273,7 +273,7 @@ asmlinkage int sys_rt_sigreturn(long r10
if (((long)frame) & 3)
goto badframe;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;
diff -urp linux-2.6.11-orig/arch/m32r/kernel/signal.c linux-2.6.11/arch/m32r/kernel/signal.c
--- linux-2.6.11-orig/arch/m32r/kernel/signal.c 2005-03-02 08:38:07.000000000 +0100
+++ linux-2.6.11/arch/m32r/kernel/signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -147,7 +147,7 @@ sys_rt_sigreturn(unsigned long r0, unsig
stack_t st;
int result;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;
diff -urp linux-2.6.11-orig/arch/m32r/kernel/sys_m32r.c linux-2.6.11/arch/m32r/kernel/sys_m32r.c
--- linux-2.6.11-orig/arch/m32r/kernel/sys_m32r.c 2005-03-02 08:38:34.000000000 +0100
+++ linux-2.6.11/arch/m32r/kernel/sys_m32r.c 2005-03-03 22:28:34.000000000 +0100
@@ -171,9 +171,9 @@ asmlinkage int sys_ipc(uint call, int fi
case SHMAT: {
ulong raddr;

- if ((ret = verify_area(VERIFY_WRITE, (ulong __user *) third,
- sizeof(ulong))))
- return ret;
+ if (!access_ok(VERIFY_WRITE, (ulong __user *) third,
+ sizeof(ulong)))
+ return -EFAULT;
ret = do_shmat (first, (char __user *) ptr, second, &raddr);
if (ret)
return ret;
diff -urp linux-2.6.11-orig/arch/s390/kernel/compat_signal.c linux-2.6.11/arch/s390/kernel/compat_signal.c
--- linux-2.6.11-orig/arch/s390/kernel/compat_signal.c 2005-03-02 08:38:26.000000000 +0100
+++ linux-2.6.11/arch/s390/kernel/compat_signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -231,7 +231,7 @@ sys32_sigaction(int sig, const struct ol

if (act) {
compat_old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(sa_handler, &act->sa_handler) ||
__get_user(sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -247,7 +247,7 @@ sys32_sigaction(int sig, const struct ol
if (!ret && oact) {
sa_handler = (unsigned long) old_ka.sa.sa_handler;
sa_restorer = (unsigned long) old_ka.sa.sa_restorer;
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(sa_handler, &oact->sa_handler) ||
__put_user(sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -416,7 +416,7 @@ asmlinkage long sys32_sigreturn(struct p
sigframe32 __user *frame = (sigframe32 __user *)regs->gprs[15];
sigset_t set;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE32))
goto badframe;
@@ -446,7 +446,7 @@ asmlinkage long sys32_rt_sigreturn(struc
int err;
mm_segment_t old_fs = get_fs();

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;
Only in linux-2.6.11/arch/s390/kernel: compat_signal.c~
diff -urp linux-2.6.11-orig/arch/s390/kernel/signal.c linux-2.6.11/arch/s390/kernel/signal.c
--- linux-2.6.11-orig/arch/s390/kernel/signal.c 2005-03-02 08:38:18.000000000 +0100
+++ linux-2.6.11/arch/s390/kernel/signal.c 2005-03-03 22:28:34.000000000 +0100
@@ -116,7 +116,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -128,7 +128,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -214,7 +214,7 @@ asmlinkage long sys_sigreturn(struct pt_
sigframe __user *frame = (sigframe __user *)regs->gprs[15];
sigset_t set;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE))
goto badframe;
@@ -240,7 +240,7 @@ asmlinkage long sys_rt_sigreturn(struct
rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15];
sigset_t set;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set.sig, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;
diff -urp linux-2.6.11-orig/arch/v850/kernel/signal.c linux-2.6.11/arch/v850/kernel/signal.c
--- linux-2.6.11-orig/arch/v850/kernel/signal.c 2005-03-02 08:38:33.000000000 +0100
+++ linux-2.6.11/arch/v850/kernel/signal.c 2005-03-03 22:28:35.000000000 +0100
@@ -102,7 +102,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -114,7 +114,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -178,7 +178,7 @@ asmlinkage int sys_sigreturn(struct pt_r
sigset_t set;
int rval;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;

if (__get_user(set.sig[0], &frame->sc.oldmask)
@@ -209,7 +209,7 @@ asmlinkage int sys_rt_sigreturn(struct p
stack_t st;
int rval;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;

if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
diff -urp linux-2.6.11-orig/arch/v850/kernel/syscalls.c linux-2.6.11/arch/v850/kernel/syscalls.c
--- linux-2.6.11-orig/arch/v850/kernel/syscalls.c 2005-03-02 08:38:12.000000000 +0100
+++ linux-2.6.11/arch/v850/kernel/syscalls.c 2005-03-03 22:28:35.000000000 +0100
@@ -62,7 +62,7 @@ sys_ipc (uint call, int first, int secon

if (!ptr)
break;
- if ((ret = verify_area (VERIFY_READ, ptr, sizeof(long)))
+ if ((ret = access_ok(VERIFY_READ, ptr, sizeof(long)) ? 0 : -EFAULT)
|| (ret = get_user(fourth.__pad, (void **)ptr)))
break;
ret = sys_semctl (first, second, third, fourth);
@@ -78,7 +78,7 @@ sys_ipc (uint call, int first, int secon

if (!ptr)
break;
- if ((ret = verify_area (VERIFY_READ, ptr, sizeof(tmp)))
+ if ((ret = access_ok(VERIFY_READ, ptr, sizeof(tmp)) ? 0 : -EFAULT)
|| (ret = copy_from_user(&tmp,
(struct ipc_kludge *) ptr,
sizeof (tmp))))
@@ -104,8 +104,8 @@ sys_ipc (uint call, int first, int secon
default: {
ulong raddr;

- if ((ret = verify_area(VERIFY_WRITE, (ulong*) third,
- sizeof(ulong))))
+ if ((ret = access_ok(VERIFY_WRITE, (ulong*) third,
+ sizeof(ulong)) ? 0 : -EFAULT))
break;
ret = do_shmat (first, (char *) ptr, second, &raddr);
if (ret)
diff -urp linux-2.6.11-orig/arch/sh64/kernel/signal.c linux-2.6.11/arch/sh64/kernel/signal.c
--- linux-2.6.11-orig/arch/sh64/kernel/signal.c 2005-03-02 08:38:09.000000000 +0100
+++ linux-2.6.11/arch/sh64/kernel/signal.c 2005-03-03 22:28:35.000000000 +0100
@@ -125,7 +125,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -137,7 +137,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -293,7 +293,7 @@ asmlinkage int sys_sigreturn(unsigned lo
sigset_t set;
long long ret;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;

if (__get_user(set.sig[0], &frame->sc.oldmask)
@@ -330,7 +330,7 @@ asmlinkage int sys_rt_sigreturn(unsigned
stack_t __user st;
long long ret;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;

if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
diff -urp linux-2.6.11-orig/arch/alpha/kernel/osf_sys.c linux-2.6.11/arch/alpha/kernel/osf_sys.c
--- linux-2.6.11-orig/arch/alpha/kernel/osf_sys.c 2005-03-02 08:37:30.000000000 +0100
+++ linux-2.6.11/arch/alpha/kernel/osf_sys.c 2005-03-03 22:28:35.000000000 +0100
@@ -437,11 +437,10 @@ asmlinkage int
osf_getdomainname(char __user *name, int namelen)
{
unsigned len;
- int i, error;
+ int i;

- error = verify_area(VERIFY_WRITE, name, namelen);
- if (error)
- goto out;
+ if (!access_ok(VERIFY_WRITE, name, namelen))
+ return -EFAULT;

len = namelen;
if (namelen > 32)
@@ -454,8 +453,8 @@ osf_getdomainname(char __user *name, int
break;
}
up_read(&uts_sem);
- out:
- return error;
+
+ return 0;
}

asmlinkage long
@@ -996,7 +995,7 @@ osf_select(int n, fd_set __user *inp, fd
if (tvp) {
time_t sec, usec;

- if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
+ if ((ret = access_ok(VERIFY_READ, tvp, sizeof(*tvp)) ? 0 : -EFAULT)
|| (ret = __get_user(sec, &tvp->tv_sec))
|| (ret = __get_user(usec, &tvp->tv_usec)))
goto out_nofds;
diff -urp linux-2.6.11-orig/arch/alpha/kernel/signal.c linux-2.6.11/arch/alpha/kernel/signal.c
--- linux-2.6.11-orig/arch/alpha/kernel/signal.c 2005-03-02 08:38:09.000000000 +0100
+++ linux-2.6.11/arch/alpha/kernel/signal.c 2005-03-03 22:28:35.000000000 +0100
@@ -91,7 +91,7 @@ osf_sigaction(int sig, const struct osf_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_flags, &act->sa_flags))
return -EFAULT;
@@ -103,7 +103,7 @@ osf_sigaction(int sig, const struct osf_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags))
return -EFAULT;
@@ -298,7 +298,7 @@ do_sigreturn(struct sigcontext __user *s
sigset_t set;

/* Verify that it's a good sigcontext before using it */
- if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
+ if (!access_ok(VERIFY_READ, sc, sizeof(*sc)))
goto give_sigsegv;
if (__get_user(set.sig[0], &sc->sc_mask))
goto give_sigsegv;
@@ -336,7 +336,7 @@ do_rt_sigreturn(struct rt_sigframe __use
sigset_t set;

/* Verify that it's a good ucontext_t before using it */
- if (verify_area(VERIFY_READ, &frame->uc, sizeof(frame->uc)))
+ if (!access_ok(VERIFY_READ, &frame->uc, sizeof(frame->uc)))
goto give_sigsegv;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto give_sigsegv;
@@ -446,7 +446,7 @@ setup_frame(int sig, struct k_sigaction

oldsp = rdusp();
frame = get_sigframe(ka, oldsp, sizeof(*frame));
- if (verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto give_sigsegv;

err |= setup_sigcontext(&frame->sc, regs, sw, set->sig[0], oldsp);
@@ -497,7 +497,7 @@ setup_rt_frame(int sig, struct k_sigacti

oldsp = rdusp();
frame = get_sigframe(ka, oldsp, sizeof(*frame));
- if (verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto give_sigsegv;

err |= copy_siginfo_to_user(&frame->info, info);
diff -urp linux-2.6.11-orig/arch/h8300/kernel/signal.c linux-2.6.11/arch/h8300/kernel/signal.c
--- linux-2.6.11-orig/arch/h8300/kernel/signal.c 2005-03-02 08:38:09.000000000 +0100
+++ linux-2.6.11/arch/h8300/kernel/signal.c 2005-03-03 22:28:35.000000000 +0100
@@ -113,7 +113,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -125,7 +125,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -222,7 +222,7 @@ asmlinkage int do_sigreturn(unsigned lon
sigset_t set;
int er0;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__get_user(set.sig[0], &frame->sc.sc_mask) ||
(_NSIG_WORDS > 1 &&
@@ -253,7 +253,7 @@ asmlinkage int do_rt_sigreturn(unsigned
sigset_t set;
int er0;

- if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;
diff -urp linux-2.6.11-orig/arch/arm26/kernel/signal.c linux-2.6.11/arch/arm26/kernel/signal.c
--- linux-2.6.11-orig/arch/arm26/kernel/signal.c 2005-03-02 08:37:51.000000000 +0100
+++ linux-2.6.11/arch/arm26/kernel/signal.c 2005-03-03 22:28:35.000000000 +0100
@@ -102,7 +102,7 @@ sys_sigaction(int sig, const struct old_

if (act) {
old_sigset_t mask;
- if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+ if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
return -EFAULT;
@@ -114,7 +114,7 @@ sys_sigaction(int sig, const struct old_
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
- if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+ if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
return -EFAULT;
@@ -186,7 +186,7 @@ asmlinkage int sys_sigreturn(struct pt_r

frame = (struct sigframe *)regs->ARM_sp;

- if (verify_area(VERIFY_READ, frame, sizeof (*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
goto badframe;
if (__get_user(set.sig[0], &frame->sc.oldmask)
|| (_NSIG_WORDS > 1
@@ -231,7 +231,7 @@ asmlinkage int sys_rt_sigreturn(struct p

frame = (struct rt_sigframe *)regs->ARM_sp;

- if (verify_area(VERIFY_READ, frame, sizeof (*frame)))
+ if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
goto badframe;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto badframe;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/