linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@bootlin.com>
To: Pascal van Leeuwen <pascalvanl@gmail.com>
Cc: linux-crypto@vger.kernel.org, antoine.tenart@bootlin.com,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	Pascal van Leeuwen <pvanleeuwen@insidesecure.com>,
	Pascal van Leeuwen <pvanleeuwen@verimatrix.com>
Subject: Re: [PATCH 2/9] crypto: inside-secure - silently return -EINVAL for input error cases
Date: Fri, 5 Jul 2019 16:36:24 +0200	[thread overview]
Message-ID: <20190705143624.GF3926@kwain> (raw)
In-Reply-To: <1562078400-969-5-git-send-email-pvanleeuwen@verimatrix.com>

Hi Pascal,

On Tue, Jul 02, 2019 at 04:39:53PM +0200, Pascal van Leeuwen wrote:
> From: Pascal van Leeuwen <pvanleeuwen@insidesecure.com>
> 
> diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
> index 503fef0..8e8c01d 100644
> --- a/drivers/crypto/inside-secure/safexcel.c
> +++ b/drivers/crypto/inside-secure/safexcel.c
> @@ -694,16 +694,31 @@ void safexcel_dequeue(struct safexcel_crypto_priv *priv, int ring)
>  inline int safexcel_rdesc_check_errors(struct safexcel_crypto_priv *priv,
>  				       struct safexcel_result_desc *rdesc)
>  {
> -	if (likely(!rdesc->result_data.error_code))
> +	if (likely((!rdesc->descriptor_overflow) &&
> +		   (!rdesc->buffer_overflow) &&
> +		   (!rdesc->result_data.error_code)))

You don't need the extra () here.

> +	if (rdesc->descriptor_overflow)
> +		dev_err(priv->dev, "Descriptor overflow detected");
> +
> +	if (rdesc->buffer_overflow)
> +		dev_err(priv->dev, "Buffer overflow detected");

You're not returning an error here, is there a reason for that?

I also remember having issues when adding those checks a while ago, Did
you see any of those two error messages when using the crypto engine?

Thanks!
Antoine

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-07-05 14:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 14:39 [PATCH 0/9] crypto: inside-secure - fix cryptomgr extratests issues Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH] crypto: inside-secure - fix scatter/gather list handling issues Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH] crypto: inside-secure - fix scatter/gather list to descriptor conversion Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH 1/9] crypto: inside-secure - keep ivsize for DES ECB modes at 0 Pascal van Leeuwen
2019-07-05 14:40   ` Antoine Tenart
2019-07-02 14:39 ` [PATCH 2/9] crypto: inside-secure - silently return -EINVAL for input error cases Pascal van Leeuwen
2019-07-05 14:36   ` Antoine Tenart [this message]
2019-07-05 14:43     ` Pascal Van Leeuwen
2019-07-05 15:50       ` Antoine Tenart
2019-07-02 14:39 ` [PATCH 3/9] crypto: inside-secure - fix incorrect skcipher output IV Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH 4/9] crypto: inside-secure - fix scatter/gather list to descriptor conversion Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH 5/9] crypto: inside-secure - fix EINVAL error (buf overflow) for AEAD decrypt Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH 6/9] crypto: inside-secure: back out parts of earlier HMAC update workaround Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH 7/9] crypto: inside-secure - let HW deal with initial hash digest Pascal van Leeuwen
2019-07-02 14:39 ` [PATCH 8/9] crypto: inside-secure - add support for arbitrary size hash/HMAC updates Pascal van Leeuwen
2019-07-02 14:40 ` [PATCH 9/9] crypto: inside-secure - add support for 0 length HMAC messages Pascal van Leeuwen
2019-07-02 21:21 ` [PATCH 0/9] crypto: inside-secure - fix cryptomgr extratests issues Pascal Van Leeuwen
2019-07-26 12:30 ` Herbert Xu

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=20190705143624.GF3926@kwain \
    --to=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=pascalvanl@gmail.com \
    --cc=pvanleeuwen@insidesecure.com \
    --cc=pvanleeuwen@verimatrix.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;
as well as URLs for NNTP newsgroup(s).