lkml.org 
[lkml]   [2003]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: fix cosa verify_area
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/drivers/net/wan/cosa.c linux-2.5.67-ac1/drivers/net/wan/cosa.c
--- linux-2.5.67/drivers/net/wan/cosa.c 2003-03-26 19:59:52.000000000 +0000
+++ linux-2.5.67-ac1/drivers/net/wan/cosa.c 2003-03-26 20:06:13.000000000 +0000
@@ -1057,7 +1057,8 @@
return -EPERM;
}

- if (get_user(addr, &(d->addr)) ||
+ if (verify_area(VERIFY_READ, d, sizeof(*d)) ||
+ __get_user(addr, &(d->addr)) ||
__get_user(len, &(d->len)) ||
__get_user(code, &(d->code)))
return -EFAULT;
@@ -1098,7 +1099,8 @@
return -EPERM;
}

- if (get_user(addr, &(d->addr)) ||
+ if (verify_area(VERIFY_READ, d, sizeof(*d)) ||
+ __get_user(addr, &(d->addr)) ||
__get_user(len, &(d->len)) ||
__get_user(code, &(d->code)))
return -EFAULT;
@@ -1106,7 +1108,7 @@
/* If something fails, force the user to reset the card */
cosa->firmware_status &= ~COSA_FW_RESET;

- if ((i=readmem(cosa, d->code, len, addr)) < 0) {
+ if ((i=readmem(cosa, code, len, addr)) < 0) {
printk(KERN_NOTICE "cosa%d: reading memory failed: %d\n",
cosa->num, i);
return -EIO;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.019 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site