Skip to content

crypto: add check for xts input length equal to zero

Andrei Botila linux-arm-kernel linux-crypto linux-s390 linuxppc-dev lkml netdev oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest22 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22crypto: arm/aes-ce - add check for xts input length equal to zeroarch/arm/crypto/aes-ce-glue.c+6 -00 replies
2/22crypto: arm/aes-neonbs - add check for xts input length equal to zeroarch/arm/crypto/aes-neonbs-glue.c+3 -00 replies
3/22crypto: arm64/aes - add check for xts input length equal to zeroarch/arm64/crypto/aes-glue.c+6 -00 replies
4/22crypto: arm64/aes-neonbs - add check for xts input length equal to zeroarch/arm64/crypto/aes-neonbs-glue.c+3 -00 replies
5/22crypto: powerpc/aes-spe - add check for xts input length equal to zeroarch/powerpc/crypto/aes-spe-glue.c+6 -00 replies
6/22crypto: s390/aes - add check for xts input length equal to zeroarch/s390/crypto/aes_s390.c+3 -00 replies
7/22crypto: s390/paes - add check for xts input length equal to zeroarch/s390/crypto/paes_s390.c+3 -00 replies
8/22crypto: x86/glue_helper - add check for xts input length equal to zeroarch/x86/crypto/glue_helper.c+3 -00 replies
9/22crypto: xts - add check for block length equal to zerocrypto/xts.c+6 -00 replies
10/22crypto: atmel-aes - add check for xts input length equal to zerodrivers/crypto/atmel-aes.c+4 -00 replies
11/22crypto: artpec6 - add check for xts input length equal to zerodrivers/crypto/axis/artpec6_crypto.c+6 -00 replies
12/22crypto: bcm - add check for xts input length equal to zerodrivers/crypto/bcm/cipher.c+3 -00 replies
13/22crypto: cavium/cpt - add check for xts input length equal to zerodrivers/crypto/cavium/cpt/cptvf_algs.c+4 -00 replies
14/22crypto: cavium/nitrox - add check for xts input length equal to zerodrivers/crypto/cavium/nitrox/nitrox_skcipher.c+6 -00 replies
15/22crypto: ccp - add check for xts input length equal to zerodrivers/crypto/ccp/ccp-crypto-aes-xts.c+3 -00 replies
16/22crypto: ccree - add check for xts input length equal to zerodrivers/crypto/ccree/cc_cipher.c+6 -51 reply
17/22crypto: chelsio - add check for xts input length equal to zerodrivers/crypto/chelsio/chcr_algo.c+4 -00 replies
18/22crypto: hisilicon/sec - add check for xts input length equal to zerodrivers/crypto/hisilicon/sec/sec_algs.c+4 -00 replies
19/22crypto: inside-secure - add check for xts input length equal to zerodrivers/crypto/inside-secure/safexcel_cipher.c+6 -07 replies
20/22crypto: octeontx - add check for xts input length equal to zerodrivers/crypto/marvell/octeontx/otx_cptvf_algs.c+5 -00 replies
21/22crypto: qce - add check for xts input length equal to zerodrivers/crypto/qce/skcipher.c+3 -01 reply
22/22crypto: vmx - add check for xts input length equal to zerodrivers/crypto/vmx/aes_xts.c+3 -00 replies

Reviews trailers per patch

2 of 22 patches have a Reviewed-by or Acked-by.

PatchStanimir VarbanovGilad Ben-Yossef
1/22
2/22
3/22
4/22
5/22
6/22
7/22
8/22
9/22
10/22
11/22
12/22
13/22
14/22
15/22
16/22A-b
17/22
18/22
19/22
20/22
21/22R-b
22/22

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/22] crypto: add check for xts input length equal to zero

From: Andrei Botila <[email protected]>

This patch set is a follow-up on the previous RFC discussion which can be found
here: https://lore.kernel.org/r/[email protected]

This series converts all XTS implementations to return 0 when the input length is equal to 0. This change is necessary in order to standardize the way skcipher algorithms handle this corner case. This check is made for other algorithms such as CBC, ARC4, CFB, OFB, SALSA20, CTR, ECB and PCBC, XTS being the outlier here.

Although some drivers do not explicitly check for requests with zero input length, their implementations might be able to deal with this case. Since we don't have the HW to test which ones are able and which ones are not we rely on the maintainers of these drivers to verify and comment if the changes are necessary in their driver or not.

One important thing to keep in mind is that in some implementations we make this check only for XTS algorithms although probably all skcipher algorithms should return 0 in case of zero input length.

This fix has been tested only on ARMv8 CE, the rest of the patches have been build tested *only*, and should be tested on actual hardware before being merged.

Andrei Botila (22):
crypto: arm/aes-ce - add check for xts input length equal to zero
crypto: arm/aes-neonbs - add check for xts input length equal to zero
crypto: arm64/aes - add check for xts input length equal to zero
crypto: arm64/aes-neonbs - add check for xts input length equal to
zero
crypto: powerpc/aes-spe - add check for xts input length equal to zero
crypto: s390/aes - add check for xts input length equal to zero
crypto: s390/paes - add check for xts input length equal to zero
crypto: x86/glue_helper - add check for xts input length equal to zero
crypto: xts - add check for block length equal to zero
crypto: atmel-aes - add check for xts input length equal to zero
crypto: artpec6 - add check for xts input length equal to zero
crypto: bcm - add check for xts input length equal to zero
crypto: cavium/cpt - add check for xts input length equal to zero
crypto: cavium/nitrox - add check for xts input length equal to zero
crypto: ccp - add check for xts input length equal to zero
crypto: ccree - add check for xts input length equal to zero
crypto: chelsio - add check for xts input length equal to zero
crypto: hisilicon/sec - add check for xts input length equal to zero
crypto: inside-secure - add check for xts input length equal to zero
crypto: octeontx - add check for xts input length equal to zero
crypto: qce - add check for xts input length equal to zero
crypto: vmx - add check for xts input length equal to zero

 arch/arm/crypto/aes-ce-glue.c                    |  6 ++++++
 arch/arm/crypto/aes-neonbs-glue.c                |  3 +++
 arch/arm64/crypto/aes-glue.c                     |  6 ++++++
 arch/arm64/crypto/aes-neonbs-glue.c              |  3 +++
 arch/powerpc/crypto/aes-spe-glue.c               |  6 ++++++
 arch/s390/crypto/aes_s390.c                      |  3 +++
 arch/s390/crypto/paes_s390.c                     |  3 +++
 arch/x86/crypto/glue_helper.c                    |  3 +++
 crypto/xts.c                                     |  6 ++++++
 drivers/crypto/atmel-aes.c                       |  4 ++++
 drivers/crypto/axis/artpec6_crypto.c             |  6 ++++++
 drivers/crypto/bcm/cipher.c                      |  3 +++
 drivers/crypto/cavium/cpt/cptvf_algs.c           |  4 ++++
 drivers/crypto/cavium/nitrox/nitrox_skcipher.c   |  6 ++++++
 drivers/crypto/ccp/ccp-crypto-aes-xts.c          |  3 +++
 drivers/crypto/ccree/cc_cipher.c                 | 11 ++++++-----
 drivers/crypto/chelsio/chcr_algo.c               |  4 ++++
 drivers/crypto/hisilicon/sec/sec_algs.c          |  4 ++++
 drivers/crypto/inside-secure/safexcel_cipher.c   |  6 ++++++
 drivers/crypto/marvell/octeontx/otx_cptvf_algs.c |  5 +++++
 drivers/crypto/qce/skcipher.c                    |  3 +++
 drivers/crypto/vmx/aes_xts.c                     |  3 +++
 22 files changed, 96 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1