Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Roman Smirnov <r.smirnov@omp.ru>
Cc: "lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	"zohar@linux.ibm.com" <zohar@linux.ibm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] crypto: mpi: add NULL checks to mpi_normalize().
Date: Fri, 9 Aug 2024 12:28:58 +0800	[thread overview]
Message-ID: <ZrWbCnhg1XYIk5IB@gondor.apana.org.au> (raw)
In-Reply-To: <4ea0ced79912e810e2655bf21896937bd8f8d24e.camel@omp.ru>

On Wed, Aug 07, 2024 at 02:20:36PM +0000, Roman Smirnov wrote:
>
> Svace found a similar case but it is no longer relevant:
> 
> NULL constant:
>     mpi_ec_mul_point()
>       ec_mulm(z3, point->z, z2, ctx)
>         ec_mod()
>           mpi_mod()
>             mpi_fdiv_r()
>               mpi_tdiv_r()
>                 mpi_tdiv_qr()
>                   mpi_resize()
>                     kcalloc()

In general, I think it's better to deal with the error at the
point of allocation.  So whoever calls mpi_resize should check
for errors and return an error if appropriate.

We can deal with this if this function is ever reintroduced.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      reply	other threads:[~2024-08-09  4:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16  8:28 [PATCH] crypto: mpi: add NULL checks to mpi_normalize() Roman Smirnov
2024-08-02 12:46 ` Herbert Xu
2024-08-07 14:20   ` Roman Smirnov
2024-08-09  4:28     ` Herbert Xu [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=ZrWbCnhg1XYIk5IB@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=r.smirnov@omp.ru \
    --cc=s.shtylyov@omp.ru \
    --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