30 Dec, 2020

1 commit

  • [ Upstream commit d33a23b0532d5d1b5b700e8641661261e7dbef61 ]

    The bitreverse helper is almost always built into the kernel,
    but in a rare randconfig build it is possible to hit a case
    in which it is a loadable module while the atmel-i2c driver
    is built-in:

    arm-linux-gnueabi-ld: drivers/crypto/atmel-i2c.o: in function `atmel_i2c_checksum':
    atmel-i2c.c:(.text+0xa0): undefined reference to `byte_rev_table'

    Add one more 'select' statement to prevent this.

    Fixes: 11105693fa05 ("crypto: atmel-ecc - introduce Microchip / Atmel ECC driver")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Herbert Xu
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     

17 Oct, 2020

1 commit

  • Pull s390 updates from Vasily Gorbik:

    - Remove address space overrides using set_fs()

    - Convert to generic vDSO

    - Convert to generic page table dumper

    - Add ARCH_HAS_DEBUG_WX support

    - Add leap seconds handling support

    - Add NVMe firmware-assisted kernel dump support

    - Extend NVMe boot support with memory clearing control and addition of
    kernel parameters

    - AP bus and zcrypt api code rework. Add adapter configure/deconfigure
    interface. Extend debug features. Add failure injection support

    - Add ECC secure private keys support

    - Add KASan support for running protected virtualization host with
    4-level paging

    - Utilize destroy page ultravisor call to speed up secure guests
    shutdown

    - Implement ioremap_wc() and ioremap_prot() with MIO in PCI code

    - Various checksum improvements

    - Other small various fixes and improvements all over the code

    * tag 's390-5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (85 commits)
    s390/uaccess: fix indentation
    s390/uaccess: add default cases for __put_user_fn()/__get_user_fn()
    s390/zcrypt: fix wrong format specifications
    s390/kprobes: move insn_page to text segment
    s390/sie: fix typo in SIGP code description
    s390/lib: fix kernel doc for memcmp()
    s390/zcrypt: Introduce Failure Injection feature
    s390/zcrypt: move ap_msg param one level up the call chain
    s390/ap/zcrypt: revisit ap and zcrypt error handling
    s390/ap: Support AP card SCLP config and deconfig operations
    s390/sclp: Add support for SCLP AP adapter config/deconfig
    s390/ap: add card/queue deconfig state
    s390/ap: add error response code field for ap queue devices
    s390/ap: split ap queue state machine state from device state
    s390/zcrypt: New config switch CONFIG_ZCRYPT_DEBUG
    s390/zcrypt: introduce msg tracking in zcrypt functions
    s390/startup: correct early pgm check info formatting
    s390: remove orphaned extern variables declarations
    s390/kasan: make sure int handler always run with DAT on
    s390/ipl: add support to control memory clearing for nvme re-IPL
    ...

    Linus Torvalds
     

13 Oct, 2020

1 commit

  • Pull crypto updates from Herbert Xu:
    "API:
    - Allow DRBG testing through user-space af_alg
    - Add tcrypt speed testing support for keyed hashes
    - Add type-safe init/exit hooks for ahash

    Algorithms:
    - Mark arc4 as obsolete and pending for future removal
    - Mark anubis, khazad, sead and tea as obsolete
    - Improve boot-time xor benchmark
    - Add OSCCA SM2 asymmetric cipher algorithm and use it for integrity

    Drivers:
    - Fixes and enhancement for XTS in caam
    - Add support for XIP8001B hwrng in xiphera-trng
    - Add RNG and hash support in sun8i-ce/sun8i-ss
    - Allow imx-rngc to be used by kernel entropy pool
    - Use crypto engine in omap-sham
    - Add support for Ingenic X1830 with ingenic"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (205 commits)
    X.509: Fix modular build of public_key_sm2
    crypto: xor - Remove unused variable count in do_xor_speed
    X.509: fix error return value on the failed path
    crypto: bcm - Verify GCM/CCM key length in setkey
    crypto: qat - drop input parameter from adf_enable_aer()
    crypto: qat - fix function parameters descriptions
    crypto: atmel-tdes - use semicolons rather than commas to separate statements
    crypto: drivers - use semicolons rather than commas to separate statements
    hwrng: mxc-rnga - use semicolons rather than commas to separate statements
    hwrng: iproc-rng200 - use semicolons rather than commas to separate statements
    hwrng: stm32 - use semicolons rather than commas to separate statements
    crypto: xor - use ktime for template benchmarking
    crypto: xor - defer load time benchmark to a later time
    crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'
    crypto: hisilicon/zip - fix the return value when device is busy
    crypto: hisilicon/zip - fix zero length input in GZIP decompress
    crypto: hisilicon/zip - fix the uncleared debug registers
    lib/mpi: Fix unused variable warnings
    crypto: x86/poly1305 - Remove assignments with no effect
    hwrng: npcm - modify readl to readb
    ...

    Linus Torvalds
     

08 Oct, 2020

1 commit

  • Introduce a new config switch CONFIG_ZCRYPT_DEBUG which
    will be used to enable some features for debugging the
    zcrypt device driver and ap bus system:

    Another patch will use this for displaying ap card and
    ap queue state information via sysfs attribute.

    A furher patch will use this to enable some special
    treatment for some fields of an crypto request to be able
    to inject failures and so help debugging with regards
    to handling of failures.

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

    Harald Freudenberger
     

18 Sep, 2020

1 commit

  • The sa2ul driver uses crypto_authenc_extractkeys and therefore
    must select CRYPTO_AUTHENC.

    Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
    Reported-by: kernel test robot
    Signed-off-by: Herbert Xu
    Reviewed-by: Keerthy
    Signed-off-by: Herbert Xu

    Herbert Xu
     

21 Aug, 2020

1 commit

  • sa2ul.c uses sha{1,256,512}_zero_message_hash, so select the
    Kconfig symbols that provide those, like other crypto drivers do.

    Fixes this build error:

    ld: drivers/crypto/sa2ul.o: in function `sa_sha_digest':
    sa2ul.c:(.text+0x2b25): undefined reference to `sha512_zero_message_hash'

    Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
    Signed-off-by: Randy Dunlap
    Reported-by: Randy Dunlap # 2020-07-29
    Cc: Herbert Xu
    Cc: "David S. Miller"
    Cc: linux-crypto@vger.kernel.org
    Cc: Tero Kristo
    Cc: Keerthy
    Reviewed-by: Keerthy
    Signed-off-by: Herbert Xu

    Randy Dunlap
     

23 Jul, 2020

1 commit

  • Adds a basic crypto driver and currently supports AES/3DES
    in cbc mode for both encryption and decryption.

    Signed-off-by: Keerthy
    [t-kristo@ti.com: major re-work to fix various bugs in the driver and to
    cleanup the code]
    Signed-off-by: Tero Kristo
    Signed-off-by: Herbert Xu

    Keerthy
     

16 Jul, 2020

1 commit

  • The Mediatek accelerator driver calls into a dynamically allocated
    skcipher of the ctr(aes) variety to perform GCM key derivation, which
    involves AES encryption of a single block consisting of NUL bytes.

    There is no point in using the skcipher API for this, so use the AES
    library interface instead.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

03 Jul, 2020

1 commit


14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

20 Mar, 2020

1 commit


28 Feb, 2020

1 commit


13 Feb, 2020

1 commit

  • Process small blocks using the fallback cipher, as a workaround for an
    observed failure (DMA-related, apparently) when computing the GCM ghash
    key. This brings a speed gain as well, since it avoids the latency of
    using the hardware engine to process small blocks.

    Using software for all 16-byte requests would be enough to make GCM
    work, but to increase performance, a larger threshold would be better.
    Measuring the performance of supported ciphers with openssl speed,
    software matches hardware at around 768-1024 bytes.

    Considering the 256-bit ciphers, software is 2-3 times faster than qce
    at 256-bytes, 30% faster at 512, and about even at 768-bytes. With
    128-bit keys, the break-even point would be around 1024-bytes.

    This adds the 'aes_sw_max_len' parameter, to set the largest request
    length processed by the software fallback. Its default is being set to
    512 bytes, a little lower than the break-even point, to balance the cost
    in CPU usage.

    Signed-off-by: Eneas U de Queiroz
    Signed-off-by: Herbert Xu

    Eneas U de Queiroz
     

09 Jan, 2020

1 commit

  • Fix up inconsistent usage of upper and lowercase letters in "Exynos"
    name.

    "EXYNOS" is not an abbreviation but a regular trademarked name.
    Therefore it should be written with lowercase letters starting with
    capital letter.

    The lowercase "Exynos" name is promoted by its manufacturer Samsung
    Electronics Co., Ltd., in advertisement materials and on website.

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Herbert Xu

    Krzysztof Kozlowski
     

27 Dec, 2019

1 commit

  • Allow the user to choose whether to build support for all algorithms
    (default), hashes-only, or skciphers-only.

    The QCE engine does not appear to scale as well as the CPU to handle
    multiple crypto requests. While the ipq40xx chips have 4-core CPUs, the
    QCE handles only 2 requests in parallel.

    Ipsec throughput seems to improve when disabling either family of
    algorithms, sharing the load with the CPU. Enabling skciphers-only
    appears to work best.

    Signed-off-by: Eneas U de Queiroz
    Signed-off-by: Herbert Xu

    Eneas U de Queiroz
     

20 Dec, 2019

1 commit

  • Currently CONFIG_CRYPTO_DEV_SAFEXCEL=y implicitly depends on
    CONFIG_HAS_IOMEM=y; consequently, on architectures without IOMEM we get
    the following build error:

    ld: drivers/crypto/inside-secure/safexcel.o: in function `safexcel_probe':
    drivers/crypto/inside-secure/safexcel.c:1692: undefined reference to `devm_platform_ioremap_resource'

    Fix the build error by adding the unspecified dependency.

    Reported-by: Brendan Higgins
    Signed-off-by: Brendan Higgins
    Signed-off-by: Herbert Xu

    Brendan Higgins
     

11 Dec, 2019

1 commit


27 Nov, 2019

1 commit


22 Nov, 2019

1 commit

  • If CRYPTO_DEV_ATMEL_AUTHENC is m, CRYPTO_DEV_ATMEL_SHA is m,
    but CRYPTO_DEV_ATMEL_AES is y, building will fail:

    drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_init_tfm':
    atmel-aes.c:(.text+0x670): undefined reference to `atmel_sha_authenc_get_reqsize'
    atmel-aes.c:(.text+0x67a): undefined reference to `atmel_sha_authenc_spawn'
    drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_setkey':
    atmel-aes.c:(.text+0x7e5): undefined reference to `atmel_sha_authenc_setkey'

    Make CRYPTO_DEV_ATMEL_AUTHENC depend on CRYPTO_DEV_ATMEL_AES,
    and select CRYPTO_DEV_ATMEL_SHA and CRYPTO_AUTHENC for it under there.

    Reported-by: Hulk Robot
    Suggested-by: Herbert Xu
    Fixes: 89a82ef87e01 ("crypto: atmel-authenc - add support to...")
    Signed-off-by: YueHaibing
    Reviewed-by: Tudor Ambarus
    Signed-off-by: Herbert Xu

    YueHaibing
     

17 Nov, 2019

1 commit

  • Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface")
    dated 20 august 2015 introduced the new skcipher API which is supposed to
    replace both blkcipher and ablkcipher. While all consumers of the API have
    been converted long ago, some producers of the ablkcipher remain, forcing
    us to keep the ablkcipher support routines alive, along with the matching
    code to expose [a]blkciphers via the skcipher API.

    So switch this driver to the skcipher API, allowing us to finally drop the
    ablkcipher code in the near future.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

08 Nov, 2019

1 commit

  • The following error is raised when CONFIG_CRYPTO_DEV_ATMEL_AES=y and
    CONFIG_CRYPTO_DEV_ATMEL_AUTHENC=m:
    drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_setkey':
    atmel-aes.c:(.text+0x9bc): undefined reference to `crypto_authenc_extractkeys'
    Makefile:1094: recipe for target 'vmlinux' failed

    Fix it by moving the selection of CRYPTO_AUTHENC under
    config CRYPTO_DEV_ATMEL_AES.

    Fixes: 89a82ef87e01 ("crypto: atmel-authenc - add support to...")
    Signed-off-by: Tudor Ambarus
    Signed-off-by: Herbert Xu

    Tudor Ambarus
     

01 Nov, 2019

4 commits


25 Oct, 2019

1 commit


04 Oct, 2019

3 commits


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
     

30 Aug, 2019

2 commits


22 Aug, 2019

1 commit

  • Another one for the cipher museum: split off DES core processing into
    a separate module so other drivers (mostly for crypto accelerators)
    can reuse the code without pulling in the generic DES cipher itself.
    This will also permit the cipher interface to be made private to the
    crypto API itself once we move the only user in the kernel (CIFS) to
    this library interface.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

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
     

26 Jul, 2019

4 commits


09 Jul, 2019

1 commit

  • Pull crypto updates from Herbert Xu:
    "Here is the crypto update for 5.3:

    API:
    - Test shash interface directly in testmgr
    - cra_driver_name is now mandatory

    Algorithms:
    - Replace arc4 crypto_cipher with library helper
    - Implement 5 way interleave for ECB, CBC and CTR on arm64
    - Add xxhash
    - Add continuous self-test on noise source to drbg
    - Update jitter RNG

    Drivers:
    - Add support for SHA204A random number generator
    - Add support for 7211 in iproc-rng200
    - Fix fuzz test failures in inside-secure
    - Fix fuzz test failures in talitos
    - Fix fuzz test failures in qat"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (143 commits)
    crypto: stm32/hash - remove interruptible condition for dma
    crypto: stm32/hash - Fix hmac issue more than 256 bytes
    crypto: stm32/crc32 - rename driver file
    crypto: amcc - remove memset after dma_alloc_coherent
    crypto: ccp - Switch to SPDX license identifiers
    crypto: ccp - Validate the the error value used to index error messages
    crypto: doc - Fix formatting of new crypto engine content
    crypto: doc - Add parameter documentation
    crypto: arm64/aes-ce - implement 5 way interleave for ECB, CBC and CTR
    crypto: arm64/aes-ce - add 5 way interleave routines
    crypto: talitos - drop icv_ool
    crypto: talitos - fix hash on SEC1.
    crypto: talitos - move struct talitos_edesc into talitos.h
    lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE
    crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
    crypto: asymmetric_keys - select CRYPTO_HASH where needed
    crypto: serpent - mark __serpent_setkey_sbox noinline
    crypto: testmgr - dynamically allocate crypto_shash
    crypto: testmgr - dynamically allocate testvec_config
    crypto: talitos - eliminate unneeded 'done' functions at build time
    ...

    Linus Torvalds