lkml.org 
[lkml]   [2001]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] net/wanrouter/wanproc.c
Date
Hi Akash,

Thanks for this. Will get back to you.


David Mandelstam
Sangoma
Tel: (905) 474-1990 x 106
(800) 388-2475
FAX: (905) 474-9223
email: dm@sangoma.com
Web site: www.sangoma.com


> -----Original Message-----
> From: Akash Jain [mailto:aki51@acura.stanford.edu]
> Sent: Tuesday, May 22, 2001 11:09 PM
> To: ncorbic@sangoma.com; dm@sangoma.com; torvalds@transmeta.com;
> alan@lxorguk.ukuu.org.uk
> Cc: linux-kernel@vger.kernel.org; su.class.cs99q@nntp.stanford.edu
> Subject: [PATCH] net/wanrouter/wanproc.c
>
>
> 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.034 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site