From: Liu Shuo <shuox.liu@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Kees Cook <keescook@chromium.org>,
Anton Vorontsov <anton@enomsg.org>,
Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
Zhang Yanmin <yanmin_zhang@linux.intel.com>
Subject: [PATCH 2/2] pstore: fix memory leak when decompress using big_oops_buf
Date: Wed, 12 Mar 2014 21:34:06 +0800 [thread overview]
Message-ID: <20140312133403.GB29079@shuo-gentoo> (raw)
In-Reply-To: <20140312132441.GA29079@shuo-gentoo>
From: Liu ShuoX <shuox.liu@intel.com>
After sucessful decompressing, the buffer which pointed by 'buf' will be
lost as 'buf' is overwrite by 'big_oops_buf' and will never be freed.
Signed-off-by: Liu ShuoX <shuox.liu@intel.com>
---
fs/pstore/platform.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 78c3c20..46d269e 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -497,6 +497,7 @@ void pstore_get_records(int quiet)
big_oops_buf_sz);
if (unzipped_len > 0) {
+ kfree(buf);
buf = big_oops_buf;
size = unzipped_len;
compressed = false;
--
1.8.3.2
next prev parent reply other threads:[~2014-03-12 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 13:24 [PATCH 1/2] pstore: fix buffer overflow while write offset equal to buffer size Liu Shuo
2014-03-12 13:34 ` Liu Shuo [this message]
2014-03-13 3:48 ` [PATCH 2/2] pstore: fix memory leak when decompress using big_oops_buf Kees Cook
2014-03-17 21:45 ` Tony Luck
2014-03-12 16:50 ` [PATCH 1/2] pstore: fix buffer overflow while write offset equal to buffer size Kees Cook
2014-03-13 2:18 ` Shuo Liu
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=20140312133403.GB29079@shuo-gentoo \
--to=shuox.liu@gmail.com \
--cc=anton@enomsg.org \
--cc=ccross@android.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=yanmin_zhang@linux.intel.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