lkml.org 
[lkml]   [2003]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectmemleak in 802.1q vlan proc code
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 {
-
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:33    [W:0.032 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site