08 Aug, 2020

1 commit

  • As said by Linus:

    A symmetric naming is only helpful if it implies symmetries in use.
    Otherwise it's actively misleading.

    In "kzalloc()", the z is meaningful and an important part of what the
    caller wants.

    In "kzfree()", the z is actively detrimental, because maybe in the
    future we really _might_ want to use that "memfill(0xdeadbeef)" or
    something. The "zero" part of the interface isn't even _relevant_.

    The main reason that kzfree() exists is to clear sensitive information
    that should not be leaked to other future users of the same memory
    objects.

    Rename kzfree() to kfree_sensitive() to follow the example of the recently
    added kvfree_sensitive() and make the intention of the API more explicit.
    In addition, memzero_explicit() is used to clear the memory to make sure
    that it won't get optimized away by the compiler.

    The renaming is done by using the command sequence:

    git grep -w --name-only kzfree |\
    xargs sed -i 's/kzfree/kfree_sensitive/'

    followed by some editing of the kfree_sensitive() kerneldoc and adding
    a kzfree backward compatibility macro in slab.h.

    [akpm@linux-foundation.org: fs/crypto/inline_crypt.c needs linux/slab.h]
    [akpm@linux-foundation.org: fix fs/crypto/inline_crypt.c some more]

    Suggested-by: Joe Perches
    Signed-off-by: Waiman Long
    Signed-off-by: Andrew Morton
    Acked-by: David Howells
    Acked-by: Michal Hocko
    Acked-by: Johannes Weiner
    Cc: Jarkko Sakkinen
    Cc: James Morris
    Cc: "Serge E. Hallyn"
    Cc: Joe Perches
    Cc: Matthew Wilcox
    Cc: David Rientjes
    Cc: Dan Carpenter
    Cc: "Jason A . Donenfeld"
    Link: http://lkml.kernel.org/r/20200616154311.12314-3-longman@redhat.com
    Signed-off-by: Linus Torvalds

    Waiman Long
     

16 Jun, 2020

1 commit

  • snprintf() returns the number of bytes that would be written,
    which may be greater than the the actual length to be written.

    show() methods should return the number of bytes printed into the
    buffer. This is the return value of scnprintf().

    Link: https://lkml.kernel.org/r/20200509085608.41061-2-chenzhou10@huawei.com
    Signed-off-by: Chen Zhou
    Signed-off-by: Heiko Carstens
    Signed-off-by: Vasily Gorbik

    Chen Zhou
     

08 May, 2020

1 commit


27 Feb, 2020

1 commit

  • aes_s390.c has several functions which allocate space for key material on
    the stack and leave the used keys there. It is considered good practice
    to clean these locations before the function returns.

    Link: https://lkml.kernel.org/r/20200221165511.GB6928@lst.de
    Signed-off-by: Torsten Duwe
    Signed-off-by: Harald Freudenberger
    Signed-off-by: Vasily Gorbik

    Torsten Duwe
     

30 Jan, 2020

3 commits

  • Extend the low level ep11 misc functions implementation by
    several functions to support EP11 key objects for paes and pkey:
    - EP11 AES secure key generation
    - EP11 AES secure key generation from given clear key value
    - EP11 AES secure key blob check
    - findcard function returns list of apqns based on given criterias
    - EP11 AES secure key derive to CPACF protected key

    Extend the pkey module to be able to generate and handle EP11
    secure keys and also use them as base for deriving protected
    keys for CPACF usage. These ioctls are extended to support
    EP11 keys: PKEY_GENSECK2, PKEY_CLR2SECK2, PKEY_VERIFYKEY2,
    PKEY_APQNS4K, PKEY_APQNS4KT, PKEY_KBLOB2PROTK2.

    Additionally the 'clear key' token to protected key now uses
    an EP11 card if the other ways (via PCKMO, via CCA) fail.

    The PAES cipher implementation needed a new upper limit for
    the max key size, but is now also working with EP11 keys.

    Signed-off-by: Harald Freudenberger
    Signed-off-by: Vasily Gorbik

    Harald Freudenberger
     
  • With this patch the paes ciphers do accept AES clear key values of
    size 16, 24 or 32 byte. The key value is internal rearranged to form a
    paes clear key token so that the pkey kernel module recognizes and
    handles this key material as source for protected keys.

    Using clear key material as a source for protected keys is a security
    risc as the raw key material is kept in memory. However, so the AES
    selftests provided with the testmanager can be run during registration
    of the paes ciphers.

    Signed-off-by: Harald Freudenberger
    Signed-off-by: Vasily Gorbik

    Harald Freudenberger
     
  • There have been some findings during Eric Biggers rework of the
    paes implementation which this patch tries to address:

    A very minor finding within paes ctr where when the cpacf instruction
    returns with only partially data en/decrytped the walk_done() was
    mistakenly done with the all data counter. Please note this can only
    happen when the kmctr returns because the protected key became invalid
    in the middle of the operation. And this is only with suspend and
    resume on a system with different effective wrapping key.

    Eric Biggers mentioned that the context struct within the tfm struct
    may be shared among multiple kernel threads. So here now a rework
    which uses a spinlock per context to protect the read and write of the
    protected key blob value. The en/decrypt functions copy the protected
    key(s) at the beginning into a param struct and do not work with the
    protected key within the context any more. If the protected key in the
    param struct becomes invalid, the key material is again converted to
    protected key(s) and the context gets this update protected by the
    spinlock. Race conditions are still possible and may result in writing
    the very same protected key value more than once. So the spinlock
    needs to make sure the protected key(s) within the context are
    consistent updated.

    The ctr page is now locked by a mutex instead of a spinlock. A similar
    patch went into the aes_s390 code as a result of a complain "sleeping
    function called from invalid context at ...algapi.h". See
    commit 1c2c7029c008 ("s390/crypto: fix possible sleep during spinlock
    aquired")' for more.

    During testing with instrumented code another issue with the xts
    en/decrypt function revealed. The retry cleared the running iv value
    and thus let to wrong en/decrypted data.

    Tested and verified with additional testcases via AF_ALG interface and
    additional selftests within the kernel (which will be made available
    as soon as possible).

    Reported-by: Eric Biggers
    Signed-off-by: Harald Freudenberger
    Signed-off-by: Vasily Gorbik

    Harald Freudenberger
     

09 Jan, 2020

2 commits

  • The CRYPTO_TFM_RES_* flags were apparently meant as a way to make the
    ->setkey() functions provide more information about errors. But these
    flags weren't actually being used or tested, and in many cases they
    weren't being set correctly anyway. So they've now been removed.

    Also, if someone ever actually needs to start better distinguishing
    ->setkey() errors (which is somewhat unlikely, as this has been unneeded
    for a long time), we'd be much better off just defining different return
    values, like -EINVAL if the key is invalid for the algorithm vs.
    -EKEYREJECTED if the key was rejected by a policy like "no weak keys".
    That would be much simpler, less error-prone, and easier to test.

    So just remove CRYPTO_TFM_RES_MASK and all the unneeded logic that
    propagates these flags around.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     
  • The CRYPTO_TFM_RES_BAD_KEY_LEN flag was apparently meant as a way to
    make the ->setkey() functions provide more information about errors.

    However, no one actually checks for this flag, which makes it pointless.

    Also, many algorithms fail to set this flag when given a bad length key.
    Reviewing just the generic implementations, this is the case for
    aes-fixed-time, cbcmac, echainiv, nhpoly1305, pcrypt, rfc3686, rfc4309,
    rfc7539, rfc7539esp, salsa20, seqiv, and xcbc. But there are probably
    many more in arch/*/crypto/ and drivers/crypto/.

    Some algorithms can even set this flag when the key is the correct
    length. For example, authenc and authencesn set it when the key payload
    is malformed in any way (not just a bad length), the atmel-sha and ccree
    drivers can set it if a memory allocation fails, and the chelsio driver
    sets it for bad auth tag lengths, not just bad key lengths.

    So even if someone actually wanted to start checking this flag (which
    seems unlikely, since it's been unused for a long time), there would be
    a lot of work needed to get it working correctly. But it would probably
    be much better to go back to the drawing board and just define different
    return values, like -EINVAL if the key is invalid for the algorithm vs.
    -EKEYREJECTED if the key was rejected by a policy like "no weak keys".
    That would be much simpler, less error-prone, and easier to test.

    So just remove this flag.

    Signed-off-by: Eric Biggers
    Reviewed-by: Horia Geantă
    Signed-off-by: Herbert Xu

    Eric Biggers
     

26 Nov, 2019

1 commit

  • Pull crypto updates from Herbert Xu:
    "API:
    - Add library interfaces of certain crypto algorithms for WireGuard
    - Remove the obsolete ablkcipher and blkcipher interfaces
    - Move add_early_randomness() out of rng_mutex

    Algorithms:
    - Add blake2b shash algorithm
    - Add blake2s shash algorithm
    - Add curve25519 kpp algorithm
    - Implement 4 way interleave in arm64/gcm-ce
    - Implement ciphertext stealing in powerpc/spe-xts
    - Add Eric Biggers's scalar accelerated ChaCha code for ARM
    - Add accelerated 32r2 code from Zinc for MIPS
    - Add OpenSSL/CRYPTOGRAMS poly1305 implementation for ARM and MIPS

    Drivers:
    - Fix entropy reading failures in ks-sa
    - Add support for sam9x60 in atmel
    - Add crypto accelerator for amlogic GXL
    - Add sun8i-ce Crypto Engine
    - Add sun8i-ss cryptographic offloader
    - Add a host of algorithms to inside-secure
    - Add NPCM RNG driver
    - add HiSilicon HPRE accelerator
    - Add HiSilicon TRNG driver"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (285 commits)
    crypto: vmx - Avoid weird build failures
    crypto: lib/chacha20poly1305 - use chacha20_crypt()
    crypto: x86/chacha - only unregister algorithms if registered
    crypto: chacha_generic - remove unnecessary setkey() functions
    crypto: amlogic - enable working on big endian kernel
    crypto: sun8i-ce - enable working on big endian
    crypto: mips/chacha - select CRYPTO_SKCIPHER, not CRYPTO_BLKCIPHER
    hwrng: ks-sa - Enable COMPILE_TEST
    crypto: essiv - remove redundant null pointer check before kfree
    crypto: atmel-aes - Change data type for "lastc" buffer
    crypto: atmel-tdes - Set the IV after {en,de}crypt
    crypto: sun4i-ss - fix big endian issues
    crypto: sun4i-ss - hide the Invalid keylen message
    crypto: sun4i-ss - use crypto_ahash_digestsize
    crypto: sun4i-ss - remove dependency on not 64BIT
    crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c
    MAINTAINERS: Add maintainer for HiSilicon SEC V2 driver
    crypto: hisilicon - add DebugFS for HiSilicon SEC
    Documentation: add DebugFS doc for HiSilicon SEC
    crypto: hisilicon - add SRIOV for HiSilicon SEC
    ...

    Linus Torvalds
     

20 Nov, 2019

1 commit

  • s390_crypto_shash_parmsize() return type is int, it
    should not be stored in a unsigned variable, which
    compared with zero.

    Reported-by: Hulk Robot
    Fixes: 3c2eb6b76cab ("s390/crypto: Support for SHA3 via CPACF (MSA6)")
    Signed-off-by: YueHaibing
    Signed-off-by: Joerg Schmidbauer
    Signed-off-by: Vasily Gorbik

    YueHaibing
     

23 Oct, 2019

3 commits

  • Convert the glue code for the S390 CPACF implementations of DES-ECB,
    DES-CBC, DES-CTR, 3DES-ECB, 3DES-CBC, and 3DES-CTR from the deprecated
    "blkcipher" API to the "skcipher" API. This is needed in order for the
    blkcipher API to be removed.

    Note: I made CTR use the same function for encryption and decryption,
    since CTR encryption and decryption are identical.

    Signed-off-by: Eric Biggers
    reviewed-by: Harald Freudenberger
    Signed-off-by: Herbert Xu

    Eric Biggers
     
  • Convert the glue code for the S390 CPACF protected key implementations
    of AES-ECB, AES-CBC, AES-XTS, and AES-CTR from the deprecated
    "blkcipher" API to the "skcipher" API. This is needed in order for the
    blkcipher API to be removed.

    Note: I made CTR use the same function for encryption and decryption,
    since CTR encryption and decryption are identical.

    Signed-off-by: Eric Biggers
    reviewed-by: Harald Freudenberger
    Signed-off-by: Herbert Xu

    Eric Biggers
     
  • Convert the glue code for the S390 CPACF implementations of AES-ECB,
    AES-CBC, AES-XTS, and AES-CTR from the deprecated "blkcipher" API to the
    "skcipher" API. This is needed in order for the blkcipher API to be
    removed.

    Note: I made CTR use the same function for encryption and decryption,
    since CTR encryption and decryption are identical.

    Signed-off-by: Eric Biggers
    Reviewed-by: Harald Freudenberger
    Signed-off-by: Herbert Xu

    Eric Biggers
     

19 Sep, 2019

1 commit

  • Pull crypto updates from Herbert Xu:
    "API:
    - Add the ability to abort a skcipher walk.

    Algorithms:
    - Fix XTS to actually do the stealing.
    - Add library helpers for AES and DES for single-block users.
    - Add library helpers for SHA256.
    - Add new DES key verification helper.
    - Add surrounding bits for ESSIV generator.
    - Add accelerations for aegis128.
    - Add test vectors for lzo-rle.

    Drivers:
    - Add i.MX8MQ support to caam.
    - Add gcm/ccm/cfb/ofb aes support in inside-secure.
    - Add ofb/cfb aes support in media-tek.
    - Add HiSilicon ZIP accelerator support.

    Others:
    - Fix potential race condition in padata.
    - Use unbound workqueues in padata"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (311 commits)
    crypto: caam - Cast to long first before pointer conversion
    crypto: ccree - enable CTS support in AES-XTS
    crypto: inside-secure - Probe transform record cache RAM sizes
    crypto: inside-secure - Base RD fetchcount on actual RD FIFO size
    crypto: inside-secure - Base CD fetchcount on actual CD FIFO size
    crypto: inside-secure - Enable extended algorithms on newer HW
    crypto: inside-secure: Corrected configuration of EIP96_TOKEN_CTRL
    crypto: inside-secure - Add EIP97/EIP197 and endianness detection
    padata: remove cpu_index from the parallel_queue
    padata: unbind parallel jobs from specific CPUs
    padata: use separate workqueues for parallel and serial work
    padata, pcrypt: take CPU hotplug lock internally in padata_alloc_possible
    crypto: pcrypt - remove padata cpumask notifier
    padata: make padata_do_parallel find alternate callback CPU
    workqueue: require CPU hotplug read exclusion for apply_workqueue_attrs
    workqueue: unconfine alloc/apply/free_workqueue_attrs()
    padata: allocate workqueue internally
    arm64: dts: imx8mq: Add CAAM node
    random: Use wait_event_freezable() in add_hwgenerator_randomness()
    crypto: ux500 - Fix COMPILE_TEST warnings
    ...

    Linus Torvalds
     

13 Sep, 2019

1 commit

  • This patch introduces sha3 support for s390.

    - Rework the s390-specific SHA1 and SHA2 related code to
    provide the basis for SHA3.
    - Provide two new kernel modules sha3_256_s390 and
    sha3_512_s390 together with new kernel options.

    Signed-off-by: Joerg Schmidbauer
    Reviewed-by: Ingo Franzki
    Reviewed-by: Harald Freudenberger
    Signed-off-by: Heiko Carstens

    Joerg Schmidbauer
     

05 Sep, 2019

2 commits

  • With 'extra run-time crypto self tests' enabled, the selftest
    for s390-xts fails with

    alg: skcipher: xts-aes-s390 encryption unexpectedly succeeded on
    test vector "random: len=0 klen=64"; expected_error=-22,
    cfg="random: inplace use_digest nosimd src_divs=[2.61%@+4006,
    84.44%@+21, 1.55%@+13, 4.50%@+344, 4.26%@+21, 2.64%@+27]"

    This special case with nbytes=0 is not handled correctly and this
    fix now makes sure that -EINVAL is returned when there is en/decrypt
    called with 0 bytes to en/decrypt.

    Signed-off-by: Harald Freudenberger
    Signed-off-by: Vasily Gorbik

    Harald Freudenberger
     
  • Rename static / file-local functions so that they do not conflict with
    the functions declared in crypto/sha256.h.

    This is a preparation patch for folding crypto/sha256.h into crypto/sha.h.

    Signed-off-by: Hans de Goede
    Signed-off-by: Herbert Xu

    Hans de Goede
     

22 Aug, 2019

3 commits


21 Aug, 2019

1 commit

  • The context used to store the key blob used a fixed 80 bytes
    buffer. And all the set_key functions did not even check the given key
    size. With CCA variable length AES cipher keys there come key blobs
    with about 136 bytes and maybe in the future there will arise the need
    to store even bigger key blobs.

    This patch reworks the paes set_key functions and the context
    buffers to work with small key blobs (
    Reviewed-by: Ingo Franzki
    Signed-off-by: Vasily Gorbik

    Harald Freudenberger
     

31 Jul, 2019

1 commit


27 Jul, 2019

1 commit

  • To help avoid confusion, add a comment to ghash-generic.c which explains
    the convention that the kernel's implementation of GHASH uses.

    Also update the Kconfig help text and module descriptions to call GHASH
    a "hash function" rather than a "message digest", since the latter
    normally means a real cryptographic hash function, which GHASH is not.

    Cc: Pascal Van Leeuwen
    Signed-off-by: Eric Biggers
    Reviewed-by: Ard Biesheuvel
    Acked-by: Pascal Van Leeuwen
    Signed-off-by: Herbert Xu

    Eric Biggers
     

15 Jun, 2019

3 commits


30 May, 2019

1 commit

  • This patch fixes a complain about possible sleep during
    spinlock aquired
    "BUG: sleeping function called from invalid context at
    include/crypto/algapi.h:426"
    for the ctr(aes) and ctr(des) s390 specific ciphers.

    Instead of using a spinlock this patch introduces a mutex
    which is save to be held in sleeping context. Please note
    a deadlock is not possible as mutex_trylock() is used.

    Signed-off-by: Harald Freudenberger
    Reported-by: Julian Wiedmann
    Cc: stable@vger.kernel.org
    Signed-off-by: Heiko Carstens

    Harald Freudenberger
     

28 May, 2019

1 commit

  • The current kernel uses improved crypto selftests. These
    tests showed that the current implementation of gcm-aes-s390
    is not able to deal with chunks of output buffers which are
    not a multiple of 16 bytes. This patch introduces a rework
    of the gcm aes s390 scatter walk handling which now is able
    to handle any input and output scatter list chunk sizes
    correctly.

    Code has been verified by the crypto selftests, the tcrypt
    kernel module and additional tests ran via the af_alg interface.

    Cc:
    Reported-by: Julian Wiedmann
    Reviewed-by: Patrick Steuer
    Signed-off-by: Harald Freudenberger
    Signed-off-by: Heiko Carstens

    Harald Freudenberger
     

07 May, 2019

1 commit

  • Pull crypto update from Herbert Xu:
    "API:
    - Add support for AEAD in simd
    - Add fuzz testing to testmgr
    - Add panic_on_fail module parameter to testmgr
    - Use per-CPU struct instead multiple variables in scompress
    - Change verify API for akcipher

    Algorithms:
    - Convert x86 AEAD algorithms over to simd
    - Forbid 2-key 3DES in FIPS mode
    - Add EC-RDSA (GOST 34.10) algorithm

    Drivers:
    - Set output IV with ctr-aes in crypto4xx
    - Set output IV in rockchip
    - Fix potential length overflow with hashing in sun4i-ss
    - Fix computation error with ctr in vmx
    - Add SM4 protected keys support in ccree
    - Remove long-broken mxc-scc driver
    - Add rfc4106(gcm(aes)) cipher support in cavium/nitrox"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (179 commits)
    crypto: ccree - use a proper le32 type for le32 val
    crypto: ccree - remove set but not used variable 'du_size'
    crypto: ccree - Make cc_sec_disable static
    crypto: ccree - fix spelling mistake "protedcted" -> "protected"
    crypto: caam/qi2 - generate hash keys in-place
    crypto: caam/qi2 - fix DMA mapping of stack memory
    crypto: caam/qi2 - fix zero-length buffer DMA mapping
    crypto: stm32/cryp - update to return iv_out
    crypto: stm32/cryp - remove request mutex protection
    crypto: stm32/cryp - add weak key check for DES
    crypto: atmel - remove set but not used variable 'alg_name'
    crypto: picoxcell - Use dev_get_drvdata()
    crypto: crypto4xx - get rid of redundant using_sd variable
    crypto: crypto4xx - use sync skcipher for fallback
    crypto: crypto4xx - fix cfb and ofb "overran dst buffer" issues
    crypto: crypto4xx - fix ctr-aes missing output IV
    crypto: ecrdsa - select ASN1 and OID_REGISTRY for EC-RDSA
    crypto: ux500 - use ccflags-y instead of CFLAGS_.o
    crypto: ccree - handle tee fips error during power management resume
    crypto: ccree - add function to handle cryptocell tee fips error
    ...

    Linus Torvalds
     

02 May, 2019

1 commit


25 Apr, 2019

2 commits

  • With the z14 machine there came also a CPACF hardware extension
    which provides a True Random Number Generator. This TRNG can
    be accessed with a new subfunction code within the CPACF prno
    instruction and provides random data with very high entropy.

    So if there is a TRNG available, let's use it for initial seeding
    and reseeding instead of the current implementation which tries
    to generate entropy based on stckf (store clock fast) jitters.

    For details about the amount of data needed and pulled for
    seeding and reseeding there can be explaining comments in the
    code found.

    Signed-off-by: Harald Freudenberger
    Signed-off-by: Martin Schwidefsky

    Harald Freudenberger
     
  • Here is a rework of the generate_entropy function of the pseudo random
    device driver exploiting the prno CPACF instruction.

    George Spelvin pointed out some issues with the existing
    implementation. One point was, that the buffer used to store the stckf
    values is 2 pages which are initially filled with get_random_bytes()
    for each 64 byte junk produced by the function. Another point was that
    the stckf values only carry entropy in the LSB and thus a buffer of
    2 pages is not really needed. Then there was a comment about the use
    of the kimd cpacf function without proper initialization.

    The rework addresses these points and now one page is used and only
    one half of this is filled with get_random_bytes() on each chunk of 64
    bytes requested data. The other half of the page is filled with stckf
    values exored into with an overlap of 4 bytes. This can be done due to
    the fact that only the lower 4 bytes carry entropy we need. For more
    details about the algorithm used, see the header of the function.

    The generate_entropy() function now uses the cpacf function klmd with
    proper initialization of the parameter block to perform the sha512
    hash.

    George also pointed out some issues with the internal buffers used for
    seeding and reads. These buffers are now zeroed with memzero_implicit
    after use.

    Signed-off-by: Harald Freudenberger
    Reported-by: George Spelvin
    Suggested-by: George Spelvin
    Reviewed-by: Patrick Steuer
    Signed-off-by: Martin Schwidefsky

    Harald Freudenberger
     

18 Apr, 2019

1 commit


25 Jan, 2019

1 commit

  • CRYPTO_TFM_REQ_WEAK_KEY confuses newcomers to the crypto API because it
    sounds like it is requesting a weak key. Actually, it is requesting
    that weak keys be forbidden (for algorithms that have the notion of
    "weak keys"; currently only DES and XTS do).

    Also it is only one letter away from CRYPTO_TFM_RES_WEAK_KEY, with which
    it can be easily confused. (This in fact happened in the UX500 driver,
    though just in some debugging messages.)

    Therefore, make the intent clear by renaming it to
    CRYPTO_TFM_REQ_FORBID_WEAK_KEYS.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     

20 Nov, 2018

1 commit

  • 'cipher' algorithms (single block ciphers) are always synchronous, so
    passing CRYPTO_ALG_ASYNC in the mask to crypto_alloc_cipher() has no
    effect. Many users therefore already don't pass it, but some still do.
    This inconsistency can cause confusion, especially since the way the
    'mask' argument works is somewhat counterintuitive.

    Thus, just remove the unneeded CRYPTO_ALG_ASYNC flags.

    This patch shouldn't change any actual behavior.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     

26 Oct, 2018

1 commit

  • Pull crypto updates from Herbert Xu:
    "API:
    - Remove VLA usage
    - Add cryptostat user-space interface
    - Add notifier for new crypto algorithms

    Algorithms:
    - Add OFB mode
    - Remove speck

    Drivers:
    - Remove x86/sha*-mb as they are buggy
    - Remove pcbc(aes) from x86/aesni
    - Improve performance of arm/ghash-ce by up to 85%
    - Implement CTS-CBC in arm64/aes-blk, faster by up to 50%
    - Remove PMULL based arm64/crc32 driver
    - Use PMULL in arm64/crct10dif
    - Add aes-ctr support in s5p-sss
    - Add caam/qi2 driver

    Others:
    - Pick better transform if one becomes available in crc-t10dif"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (124 commits)
    crypto: chelsio - Update ntx queue received from cxgb4
    crypto: ccree - avoid implicit enum conversion
    crypto: caam - add SPDX license identifier to all files
    crypto: caam/qi - simplify CGR allocation, freeing
    crypto: mxs-dcp - make symbols 'sha1_null_hash' and 'sha256_null_hash' static
    crypto: arm64/aes-blk - ensure XTS mask is always loaded
    crypto: testmgr - fix sizeof() on COMP_BUF_SIZE
    crypto: chtls - remove set but not used variable 'csk'
    crypto: axis - fix platform_no_drv_owner.cocci warnings
    crypto: x86/aes-ni - fix build error following fpu template removal
    crypto: arm64/aes - fix handling sub-block CTS-CBC inputs
    crypto: caam/qi2 - avoid double export
    crypto: mxs-dcp - Fix AES issues
    crypto: mxs-dcp - Fix SHA null hashes and output length
    crypto: mxs-dcp - Implement sha import/export
    crypto: aegis/generic - fix for big endian systems
    crypto: morus/generic - fix for big endian systems
    crypto: lrw - fix rebase error after out of bounds fix
    crypto: cavium/nitrox - use pci_alloc_irq_vectors() while enabling MSI-X.
    crypto: cavium/nitrox - NITROX command queue changes.
    ...

    Linus Torvalds
     

10 Oct, 2018

1 commit

  • Enhance the paes_s390 kernel module to allow the paes cipher to
    accept variable length key material. The key material accepted by
    the paes cipher is a key blob of various types. As of today, two
    key blob types are supported: CCA secure key blobs and protected
    key blobs.

    Signed-off-by: Ingo Franzki
    Reviewed-by: Harald Freudenberger
    Reviewed-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Ingo Franzki
     

28 Sep, 2018

1 commit

  • In the quest to remove all stack VLA usage from the kernel[1], this
    replaces struct crypto_skcipher and SKCIPHER_REQUEST_ON_STACK() usage
    with struct crypto_sync_skcipher and SYNC_SKCIPHER_REQUEST_ON_STACK(),
    which uses a fixed stack size.

    [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux-s390@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: Herbert Xu

    Kees Cook
     

04 Sep, 2018

1 commit

  • The return code of cpacf_kmc() is less than the number of
    bytes to process in case of an error, not greater.
    The crypt routines for the other cipher modes already have
    this correctly.

    Cc: stable@vger.kernel.org # v4.11+
    Fixes: 279378430768 ("s390/crypt: Add protected key AES module")
    Signed-off-by: Ingo Franzki
    Acked-by: Harald Freudenberger
    Signed-off-by: Martin Schwidefsky

    Ingo Franzki