All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.ibm.com>
To: Mimi Zohar <zohar@linux.ibm.com>, linux-integrity@vger.kernel.org
Cc: Petr Vorel <pvorel@suse.cz>, Vitaly Chikunov <vt@altlinux.org>
Subject: Re: [PATCH ima-evm-utils v2 09/12] Fix potential use after free in read_tpm_banks()
Date: Tue, 13 Sep 2022 12:38:46 -0400	[thread overview]
Message-ID: <c7c0e63d-8c7f-2c75-9247-cc93758ce946@linux.ibm.com> (raw)
In-Reply-To: <20220906195021.854090-10-zohar@linux.ibm.com>



On 9/6/22 15:50, Mimi Zohar wrote:
> On failure to read TPM 2.0 bank PCRs 'errmsg' is not properly set to
> NULL after being freed.  Fix potential use after free.
> 
> Fixes: 3472f9ba9c05 ("ima-evm-utils: read the PCRs for the requested TPM banks")
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
>   src/evmctl.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/evmctl.c b/src/evmctl.c
> index fa588e0caba2..a497b1a468d6 100644
> --- a/src/evmctl.c
> +++ b/src/evmctl.c
> @@ -2075,6 +2075,7 @@ static int read_tpm_banks(int num_banks, struct tpm_bank_info *bank)
>   				log_debug("Failed to read %s PCRs: (%s)\n",
>   					  bank[i].algo_name, errmsg);
>   				free(errmsg);
> +				errmsg = NULL;
>   				bank[i].supported = 0;
>   			}
>   		}

  reply	other threads:[~2022-09-13 17:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 19:50 [PATCH ima-evm-utils v2 00/12] address deprecated warnings Mimi Zohar
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 01/12] travis: use the distro OpenSSL version on jammy Mimi Zohar
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 02/12] travis: update dist=focal Mimi Zohar
2022-09-13 16:39   ` Stefan Berger
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 03/12] Update configure.ac to address a couple of obsolete warnings Mimi Zohar
2022-09-13 16:40   ` Stefan Berger
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 04/12] Deprecate IMA signature version 1 Mimi Zohar
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 05/12] Replace the low level SHA1 calls when calculating the TPM 1.2 PCRs Mimi Zohar
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 06/12] Replace the low level HMAC calls when calculating the EVM HMAC Mimi Zohar
2022-09-06 20:31   ` Stefan Berger
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 07/12] Add missing EVP_MD_CTX_free() call in calc_evm_hash() Mimi Zohar
2022-09-06 20:36   ` Stefan Berger
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 08/12] Disable use of OpenSSL "engine" support Mimi Zohar
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 09/12] Fix potential use after free in read_tpm_banks() Mimi Zohar
2022-09-13 16:38   ` Stefan Berger [this message]
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 10/12] Limit the file hash algorithm name length Mimi Zohar
2022-09-13 16:35   ` Stefan Berger
2022-09-06 19:50 ` [PATCH ima-evm-utils v2 11/12] Missing template data size lower bounds checking Mimi Zohar
2022-09-13 16:34   ` Stefan Berger
2022-09-06 19:50 ` [RFC PATCH ima-evm-utils v2 12/12] Limit configuring OpenSSL engine support Mimi Zohar
2022-09-07 15:43   ` Vitaly Chikunov

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=c7c0e63d-8c7f-2c75-9247-cc93758ce946@linux.ibm.com \
    --to=stefanb@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=pvorel@suse.cz \
    --cc=vt@altlinux.org \
    --cc=zohar@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.