Re: [PATCH 3/3] ima-evm-utils: fix overflow on printing boot_aggregate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux