Check returns of {copy_{from, to},
Subsystems (4)
PATCH 1/1 Check returns of {copy_{from, to},
Patch compiles, and tested. Please apply.
http://www.anomalistic.org/patches/sunrpc-check-ret-fixes-2.6.1-rc1-mm1.patch
net/sunrpc/sysctl.c +6 -3
@@ -81,7 +81,8 @@if (left >sizeof (tmpbuf) -1 )return -EINVAL ; -copy_from_user (tmpbuf, p, left); +if (copy_from_user (tmpbuf, p, left)) +return -EFAULT ; tmpbuf[left] ='\0' ;for (p = tmpbuf, value =0 ;'0' <= *p && *p <='9' ; p++, left--)
@@ -101,9 +102,11 @@ len =sprintf (tmpbuf,"%d" , *(unsigned int *) table->data);if (len > left) len = left; -__copy_to_user (buffer, tmpbuf, len); +if (__copy_to_user (buffer, tmpbuf, len)) +return -EFAULT ;if ((left -= len) >0 ) { -put_user ('\n' , (char *)buffer + len); +if (put_user ('\n' , (char *)buffer + len)) +return -EFAULT ; left--; } }
Signature · 8 lines
Eugene TEO <[email protected]> <http://www.anomalistic.org/> 1024D/14A0DDE5 print D851 4574 E357 469C D308 A01E 7321 A38A 14A0 DDE5 main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); } _______________________________________________ Kernel-janitors mailing list [email protected] http://lists.osdl.org/mailman/listinfo/kernel-janitors