From: tip-bot for Jesper Juhl <jj@chaosbits.net>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
jj@chaosbits.net, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/urgent] x86/boot-image: Don't leak phdrs in arch/x86/boot /compressed/misc.c::Parse_elf()
Date: Thu, 26 Jan 2012 05:39:33 -0800 [thread overview]
Message-ID: <tip-5067cf53cac9b36d42ebb3a45bb12259d0bc1e68@git.kernel.org> (raw)
In-Reply-To: <alpine.LNX.2.00.1201232332590.8772@swampdragon.chaosbits.net>
Commit-ID: 5067cf53cac9b36d42ebb3a45bb12259d0bc1e68
Gitweb: http://git.kernel.org/tip/5067cf53cac9b36d42ebb3a45bb12259d0bc1e68
Author: Jesper Juhl <jj@chaosbits.net>
AuthorDate: Mon, 23 Jan 2012 23:34:59 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 26 Jan 2012 11:30:29 +0100
x86/boot-image: Don't leak phdrs in arch/x86/boot/compressed/misc.c::Parse_elf()
We allocate memory with malloc(), but neglect to free it before
the variable 'phdrs' goes out of scope --> leak.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1201232332590.8772@swampdragon.chaosbits.net
[ Mostly harmless. ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/boot/compressed/misc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 3a19d04..7116dcb 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -321,6 +321,8 @@ static void parse_elf(void *output)
default: /* Ignore other PT_* */ break;
}
}
+
+ free(phdrs);
}
asmlinkage void decompress_kernel(void *rmode, memptr heap,
prev parent reply other threads:[~2012-01-26 13:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-23 22:34 [PATCH] Don't leak in arch/x86/boot/compressed/misc.c::parse_elf() Jesper Juhl
2012-01-26 13:39 ` tip-bot for Jesper Juhl [this message]
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=tip-5067cf53cac9b36d42ebb3a45bb12259d0bc1e68@git.kernel.org \
--to=jj@chaosbits.net \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome