LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Horia Geanta <horia.geanta@nxp.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Iuliana Prodan <iuliana.prodan@nxp.com>,
	Aymen Sghaier <aymen.sghaier@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH v2 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input
Date: Fri, 24 May 2019 06:52:20 +0000	[thread overview]
Message-ID: <VI1PR0402MB348566DBD83A4FE5B9B5E42598020@VI1PR0402MB3485.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20190523123813.xosynrnsdpqfieqv@gondor.apana.org.au>

On 5/23/2019 3:38 PM, Herbert Xu wrote:
> On Thu, May 23, 2019 at 10:02:41AM +0000, Horia Geanta wrote:
>>
>> When crypto_register_akcipher fails, it merely prints a warning and falls
>> through (does not immediately return), thus there's no leak.
> 
> How can this work? Wouldn't the exit path then unregister a bunch of
> unregistered algorithms and crash?
> 
You're actually right.
zero_buffer is leaked in case crypto_register_akcipher fails.

Besides this, there is an existing issue (independent of current patch) with
algorithm registration: algorithms (in fact, rsa) are unregistered even if
registration might have failed.
This should be addressed separately.

Thanks,
Horia

      reply	other threads:[~2019-05-24  6:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 11:25 Iuliana Prodan
2019-05-15 11:25 ` [PATCH v2 2/2] crypto: caam - strip input without changing crypto request Iuliana Prodan
2019-05-15 12:59   ` Horia Geanta
2019-05-15 14:00     ` Iuliana Prodan
2019-05-15 12:45 ` [PATCH v2 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input Horia Geanta
2019-05-23  6:12 ` Herbert Xu
2019-05-23  8:08   ` Iuliana Prodan
2019-05-23 10:02   ` Horia Geanta
2019-05-23 12:38     ` Herbert Xu
2019-05-24  6:52       ` Horia Geanta [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:
  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=VI1PR0402MB348566DBD83A4FE5B9B5E42598020@VI1PR0402MB3485.eurprd04.prod.outlook.com \
    --to=horia.geanta@nxp.com \
    --cc=aymen.sghaier@nxp.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=iuliana.prodan@nxp.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH v2 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input' \
    /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

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).