linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Van Leeuwen, Pascal" <pvanleeuwen@rambus.com>
To: "Horia Geantă" <horia.geanta@nxp.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>
Cc: "Andrei Botila \(OSS\)" <andrei.botila@oss.nxp.com>,
	Andrei Botila <andrei.botila@nxp.com>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@axis.com" <linux-arm-kernel@axis.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH 19/22] crypto: inside-secure - add check for xts input length equal to zero
Date: Mon, 10 Aug 2020 21:37:50 +0000	[thread overview]
Message-ID: <CY4PR0401MB36527830624AD214E801BE53C3440@CY4PR0401MB3652.namprd04.prod.outlook.com> (raw)
In-Reply-To: <fd3e5862-3357-7dfc-6c75-30086ab19f82@nxp.com>

> -----Original Message-----
> From: Horia Geantă <horia.geanta@nxp.com>
> Sent: Monday, August 10, 2020 4:34 PM
> To: Herbert Xu <herbert@gondor.apana.org.au>; Van Leeuwen, Pascal <pvanleeuwen@rambus.com>
> Cc: Andrei Botila (OSS) <andrei.botila@oss.nxp.com>; David S. Miller <davem@davemloft.net>; linux-crypto@vger.kernel.org; linux-
> arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-s390@vger.kernel.org;
> x86@kernel.org; linux-arm-kernel@axis.com; Andrei Botila <andrei.botila@nxp.com>; Antoine Tenart <antoine.tenart@bootlin.com>
> Subject: Re: [PATCH 19/22] crypto: inside-secure - add check for xts input length equal to zero
>
> <<< External Email >>>
> On 8/10/2020 4:45 PM, Herbert Xu wrote:
> > On Mon, Aug 10, 2020 at 10:20:20AM +0000, Van Leeuwen, Pascal wrote:
> >>
> >> With all due respect, but this makes no sense.
> >
> > I agree.  This is a lot of churn for no gain.
> >
> I would say the gain is that all skcipher algorithms would behave the same
> when input length equals zero - i.e. treat the request as a no-op.
>
XTS already behaves differently because it can accept any byte amount as long
as it is not in the range 0 -16. So far, you got an EINVAL error for lengths < 16.
The special exception on top of that for length 0 does not improve anything.

Treating a request of length 0 as a no-op is not a useful feature here, as there
is no use case where that would make sense. XTS encrypts blocks (usually disk
sectors), and cannot be chained. So an attempt to encrypt a zero length block
is most certainly some kind of error (e.g. trying to use XTS for something it
was not designed to do - big security mistake!).

> We can't say "no input" has any meaning to the other skcipher algorithms,
> but the convention is to accept this case and just return 0.
> I don't see why XTS has to be handled differently.
>
I don't see why you would blindly follow some historical convention ...
unless maybe there was some existing real use case that would benefit?

BTW: for generic ciphers I could think of some use cases where the zero
length request being a no-op makes sense if the application does not
bother to check how much data it has gathered to process (which may be
nothing), but I can't see how this could apply to XTS, being block-based.

> Thanks,
> Horia

Regards,
Pascal van Leeuwen
Silicon IP Architect Multi-Protocol Engines, Rambus Security
Rambus ROTW Holding BV
+31-73 6581953

Note: The Inside Secure/Verimatrix Silicon IP team was recently acquired by Rambus.
Please be so kind to update your e-mail address book with my new e-mail address.


** This message and any attachments are for the sole use of the intended recipient(s). It may contain information that is confidential and privileged. If you are not the intended recipient of this message, you are prohibited from printing, copying, forwarding or saving it. Please delete the message and attachments and notify the sender immediately. **

Rambus Inc.<http://www.rambus.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-08-10 21:39 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 16:19 [PATCH 00/22] crypto: add check for xts input length equal to zero Andrei Botila
2020-08-07 16:19 ` [PATCH 01/22] crypto: arm/aes-ce - " Andrei Botila
2020-08-07 16:19 ` [PATCH 02/22] crypto: arm/aes-neonbs " Andrei Botila
2020-08-07 16:19 ` [PATCH 03/22] crypto: arm64/aes " Andrei Botila
2020-08-07 16:19 ` [PATCH 04/22] crypto: arm64/aes-neonbs " Andrei Botila
2020-08-07 16:19 ` [PATCH 05/22] crypto: powerpc/aes-spe " Andrei Botila
2020-08-07 16:19 ` [PATCH 06/22] crypto: s390/aes " Andrei Botila
2020-08-07 16:19 ` [PATCH 07/22] crypto: s390/paes " Andrei Botila
2020-08-07 16:19 ` [PATCH 08/22] crypto: x86/glue_helper " Andrei Botila
2020-08-07 16:19 ` [PATCH 09/22] crypto: xts - add check for block " Andrei Botila
2020-08-07 16:19 ` [PATCH 10/22] crypto: atmel-aes - add check for xts input " Andrei Botila
2020-08-07 18:06   ` kernel test robot
2020-08-07 16:19 ` [PATCH 11/22] crypto: artpec6 " Andrei Botila
2020-08-07 16:20 ` [PATCH 12/22] crypto: bcm " Andrei Botila
2020-08-07 16:20 ` [PATCH 13/22] crypto: cavium/cpt " Andrei Botila
2020-08-07 16:20 ` [PATCH 14/22] crypto: cavium/nitrox " Andrei Botila
2020-08-07 16:20 ` [PATCH 15/22] crypto: ccp " Andrei Botila
2020-08-07 16:20 ` [PATCH 16/22] crypto: ccree " Andrei Botila
2020-08-08 12:10   ` Gilad Ben-Yossef
2020-08-07 16:20 ` [PATCH 17/22] crypto: chelsio " Andrei Botila
2020-08-07 16:20 ` [PATCH 18/22] crypto: hisilicon/sec " Andrei Botila
2020-08-07 16:20 ` [PATCH 19/22] crypto: inside-secure " Andrei Botila
2020-08-10 10:20   ` Van Leeuwen, Pascal
2020-08-10 13:45     ` Herbert Xu
2020-08-10 14:33       ` Horia Geantă
2020-08-10 17:03         ` Eric Biggers
2020-08-11 15:28           ` Horia Geantă
2020-08-12  0:36             ` Herbert Xu
2020-08-10 21:37         ` Van Leeuwen, Pascal [this message]
2020-08-07 16:20 ` [PATCH 20/22] crypto: octeontx " Andrei Botila
2020-08-07 16:20 ` [PATCH 21/22] crypto: qce " Andrei Botila
2020-08-07 17:59   ` Stanimir Varbanov
2020-08-07 16:20 ` [PATCH 22/22] crypto: vmx " Andrei Botila

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=CY4PR0401MB36527830624AD214E801BE53C3440@CY4PR0401MB3652.namprd04.prod.outlook.com \
    --to=pvanleeuwen@rambus.com \
    --cc=andrei.botila@nxp.com \
    --cc=andrei.botila@oss.nxp.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=linux-arm-kernel@axis.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=x86@kernel.org \
    /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).