public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
From: Bruno Meneguele <bmeneg@redhat.com>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: linux-integrity@vger.kernel.org, Petr Vorel <pvorel@suse.cz>,
	Vitaly Chikunov <vt@altlinux.org>
Subject: Re: [PATCH 3/3] ima-evm-utils: fix overflow on printing boot_aggregate
Date: Wed, 15 Jul 2020 19:33:58 -0300	[thread overview]
Message-ID: <20200715223358.GK3720@glitch> (raw)
In-Reply-To: <1594852207.12900.350.camel@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

On Wed, Jul 15, 2020 at 06:30:07PM -0400, Mimi Zohar wrote:
> On Wed, 2020-07-15 at 18:39 -0300, Bruno Meneguele wrote:
> > diff --git a/src/evmctl.c b/src/evmctl.c
> > index 2f5bd52..2bd37c2 100644
> > --- a/src/evmctl.c
> > +++ b/src/evmctl.c
> > @@ -2252,7 +2252,8 @@ static int cmd_ima_bootaggr(struct command *cmd)
> >  		bootaggr_len += strlen(tpm_banks[i].algo_name) + 1;
> >  		bootaggr_len += (tpm_banks[i].digest_size * 2) + 1;
> >  	}
> > -	bootaggr = malloc(bootaggr_len);
> > +	/* Make room for the leading \0 */
> 
> ^Trailing null
> 

hahah.. of course.

Thanks :)

> Mimi
> 
> > +	bootaggr = malloc(bootaggr_len + 1);
> >  
> >  	/*
> >  	 * Calculate and convert the per TPM 2.0 PCR bank algorithm
> 

-- 
bmeneg 
PGP Key: http://bmeneg.com/pubkey.txt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-07-15 22:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 21:39 [PATCH 0/3] ima-evm-utils: miscellanous bug fixes Bruno Meneguele
2020-07-15 21:39 ` [PATCH 1/3] ima-evm-utils: fix empty label at end of function Bruno Meneguele
2020-07-15 21:39 ` [PATCH 2/3] ima-evm-utils: fix memory leak in case of error Bruno Meneguele
2020-07-15 21:39 ` [PATCH 3/3] ima-evm-utils: fix overflow on printing boot_aggregate Bruno Meneguele
2020-07-15 22:30   ` Mimi Zohar
2020-07-15 22:33     ` Bruno Meneguele [this message]
2020-07-15 22:30 ` [PATCH 0/3] ima-evm-utils: miscellanous bug fixes Mimi Zohar

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=20200715223358.GK3720@glitch \
    --to=bmeneg@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox