lkml.org 
[lkml]   [2001]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] net/wanrouter/wanproc.c
From
Hi All,
I am working with Dawson Engler's meta-compillation group @ Stanford.

In net/wanrouter/wanproc.c the authors check for a bad copy_to_user and
immediately return -EFAULT. However, it is necessary to rollback some
allocated memory. This can leak memory over time, thus leading to
system instability and lack of resources.

Thanks!
-Akash Jain

--- net/wanrouter/wanproc.c.orig Thu Apr 12 12:11:39 2001
+++ net/wanrouter/wanproc.c Thu May 17 12:52:05 2001
@@ -267,8 +267,10 @@
offs = file->f_pos;
if (offs < pos) {
len = min(pos - offs, count);
- if(copy_to_user(buf, (page + offs), len))
- return -EFAULT;
+ if(copy_to_user(buf, (page + offs), len)){
+ kfree(page);
+ return -EFAULT;
+ }
file->f_pos += len;
}
else
-
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 12:53    [W:0.044 / U:3.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site