linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* memleak in 802.1q vlan proc code
@ 2003-03-09 21:21 Oleg Drokin
  2003-03-09 21:41 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Drokin @ 2003-03-09 21:21 UTC (permalink / raw)
  To: alan, davem, linux-kernel

Hello!

   There is a memleak on error exit path, identical in 2.4 and 2.5.
   Same patch should apply to 2.4 and 2.5.

   Found with help of smatch + enhanced unfree script.

Bye,
    Oleg
===== net/8021q/vlanproc.c 1.6 vs edited =====
--- 1.6/net/8021q/vlanproc.c	Sat Aug 10 06:36:57 2002
+++ edited/net/8021q/vlanproc.c	Mon Mar 10 00:17:23 2003
@@ -252,8 +252,10 @@
 	offs = file->f_pos;
 	if (offs < pos) {
 		len = min_t(int, pos - offs, count);
-		if (copy_to_user(buf, (page + offs), len))
+		if (copy_to_user(buf, (page + offs), len)) {
+			kfree(page);
 			return -EFAULT;
+		}
 
 		file->f_pos += len;
 	} else {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: memleak in 802.1q vlan proc code
  2003-03-09 21:21 memleak in 802.1q vlan proc code Oleg Drokin
@ 2003-03-09 21:41 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-03-09 21:41 UTC (permalink / raw)
  To: green; +Cc: alan, linux-kernel


Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-09 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-09 21:21 memleak in 802.1q vlan proc code Oleg Drokin
2003-03-09 21:41 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).