[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1597189480.51836.1475048451846.JavaMail.zimbra@redhat.com>
Date: Wed, 28 Sep 2016 03:40:51 -0400 (EDT)
From: Jan Stancek <jstancek@...hat.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Marcelo Cerri <marcelo.cerri@...onical.com>,
rui y wang <rui.y.wang@...el.com>,
mhcerri@...ux.vnet.ibm.com, leosilva@...ux.vnet.ibm.com,
pfsmorigo@...ux.vnet.ibm.com, linux-crypto@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7
----- Original Message -----
> From: "Herbert Xu" <herbert@...dor.apana.org.au>
> To: "Marcelo Cerri" <marcelo.cerri@...onical.com>
> Cc: "Jan Stancek" <jstancek@...hat.com>, "rui y wang" <rui.y.wang@...el.com>, mhcerri@...ux.vnet.ibm.com,
> leosilva@...ux.vnet.ibm.com, pfsmorigo@...ux.vnet.ibm.com, linux-crypto@...r.kernel.org,
> linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
> Sent: Wednesday, 28 September, 2016 4:45:49 AM
> Subject: Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7
>
> On Tue, Sep 27, 2016 at 04:46:44PM -0300, Marcelo Cerri wrote:
> >
> > Can you check if the problem occurs with this patch?
>
> In light of the fact that padlock-sha is the correct example
> to follow, you only need to add one line to the init_tfm fucntion
> to update the descsize based on that of the fallback.
Thanks for clearing up how this works in padlock-sha, but
we are not exactly in same situation with p8_ghash.
p8_ghash_init_tfm() already updates descsize. Problem in original report
is that without custom export/import/statesize p8_ghash_alg.statesize
gets initialized by shash_prepare_alg() to alg->descsize:
crash> p p8_ghash_alg.statesize
$1 = 56
testmgr allocates space for export based on crypto_shash_statesize(),
but shash_default_export() writes based on crypto_shash_descsize():
[ 8.297902] state: c0000004b873aa80, statesize: 56
[ 8.297932] shash_default_export memcpy c0000004b873aa80 c0000004b8607da0, len: 76
so I think we need either:
1) make sure p8_ghash_alg.descsize is correct before we register shash,
this is what Marcelo's last patch is doing
2) provide custom export/import/statesize for p8_ghash_alg
Regards,
Jan
>
> Thanks,
> --
> Email: Herbert Xu <herbert@...dor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
Powered by blists - more mailing lists