From: Oleg Drokin <green@linuxhacker.ru>
To: torvalds@transmeta.com, alan@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Memleak in iso9660 fs (rockridge extension) on read error
Date: Sun, 9 Mar 2003 21:27:26 +0300 [thread overview]
Message-ID: <20030309182726.GA29009@linuxhacker.ru> (raw)
Hello!
I am looking at fs/isofs/rock.c::MAYBE_CONTINUE() macros
in latest 2.4 bk tree. (latest 2.5 have the same problem)
Seems that it opens a memleak in case of read error of rock-ridge attribute.
The caller of the macros assumes that when MAYBE_CONTINUE macros is over
(and not jumping to "out" label), then buffer is freed. (The funny thing is
that the macro only jumps to "out" if buffer allocation failed now, so
nothing to free, and every caller tries to free buffer if possible).
Perhaps something like following patch should help (applies to 2.4 and 2.5).
Found with help of smatch and enchanced unfree script.
Bye,
Oleg
===== fs/isofs/rock.c 1.6 vs edited =====
--- 1.6/fs/isofs/rock.c Tue Feb 5 17:10:25 2002
+++ edited/fs/isofs/rock.c Sun Mar 9 21:23:07 2003
@@ -81,6 +81,7 @@
goto LABEL; \
} \
printk("Unable to read rock-ridge attributes\n"); \
+ goto out;
}}
/* This is the inner layer of the get filename routine, and is called
reply other threads:[~2003-03-09 18:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030309182726.GA29009@linuxhacker.ru \
--to=green@linuxhacker.ru \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox