From: Tyler Hicks <tyhicks@canonical.com>
To: "Geyslan G. Bem" <geyslan@gmail.com>
Cc: ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org,
joe@perches.com, kernel-br@googlegroups.com
Subject: Re: [PATCH] ecryptfs: Fix memory leakage in keystore.c
Date: Wed, 16 Oct 2013 18:11:02 -0700 [thread overview]
Message-ID: <20131017011101.GA3860@boyd> (raw)
In-Reply-To: <1381520956-20282-1-git-send-email-geyslan@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]
On 2013-10-11 16:49:16, Geyslan G. Bem wrote:
> In 'decrypt_pki_encrypted_session_key' function:
>
> Initializes 'payload' pointer and releases it on exit.
>
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
> ---
Thanks! This one was easy to verify by auditing the code, but I was also
able to verify the leak with kmemleak.
I've targeted it for stable and pushed it to the eCryptfs next branch.
Tyler
> fs/ecryptfs/keystore.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index 7d52806..4725a07 100644
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -1149,7 +1149,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
> struct ecryptfs_msg_ctx *msg_ctx;
> struct ecryptfs_message *msg = NULL;
> char *auth_tok_sig;
> - char *payload;
> + char *payload = NULL;
> size_t payload_len = 0;
> int rc;
>
> @@ -1203,6 +1203,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
> }
> out:
> kfree(msg);
> + kfree(payload);
> return rc;
> }
>
> --
> 1.8.4
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-10-17 1:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 19:49 [PATCH] ecryptfs: Fix memory leakage in keystore.c Geyslan G. Bem
2013-10-17 1:11 ` Tyler Hicks [this message]
2013-10-17 1:21 ` Geyslan Gregório Bem
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=20131017011101.GA3860@boyd \
--to=tyhicks@canonical.com \
--cc=ecryptfs@vger.kernel.org \
--cc=geyslan@gmail.com \
--cc=joe@perches.com \
--cc=kernel-br@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
/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