archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <>
To: Colin King <>
Cc: James Bottomley <>,
	Mimi Zohar <>,
	David Howells <>,
	James Morris <>,
	"Serge E . Hallyn" <>,,,,,
Subject: Re: [PATCH] security: keys: trusted: Fix memory leaks on allocated blob
Date: Tue, 27 Jul 2021 06:05:57 +0300	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, Jul 23, 2021 at 06:21:21PM +0100, Colin King wrote:
> From: Colin Ian King <>
> There are several error return paths that don't kfree the allocated
> blob, leading to memory leaks. Ensure blob is initialized to null as
> some of the error return paths in function tpm2_key_decode do not
> change blob. Add an error return path to kfree blob and use this on
> the current leaky returns.
> Addresses-Coverity: ("Resource leak")
> Fixes: f2219745250f ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs")
> Signed-off-by: Colin Ian King <>
Reviewed-by: Jarkko Sakkinen <>

Probably makes sense (for me) to add also




      parent reply	other threads:[~2021-07-27  3:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 17:21 [PATCH] security: keys: trusted: Fix memory leaks on allocated blob Colin King
2021-07-26  5:33 ` Sumit Garg
2021-07-26  8:50 ` Dan Carpenter
2021-07-26 10:56   ` Colin Ian King
2021-07-27  3:05 ` Jarkko Sakkinen [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).