1. 04 Dec, 2020 2 commits
    • Ard Biesheuvel's avatar
      crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata · f3456b9f
      Ard Biesheuvel authored
      ARM Cortex-A57 and Cortex-A72 cores running in 32-bit mode are affected
      by silicon errata #1742098 and #1655431, respectively, where the second
      instruction of a AES instruction pair may execute twice if an interrupt
      is taken right after the first instruction consumes an input register of
      which a single 32-bit lane has been updated the last time it was modified.
      
      This is not such a rare occurrence as it may seem: in counter mode, only
      the least significant 32-bit word is incremented in the absence of a
      carry, which makes our counter mode implementation susceptible to these
      errata.
      
      So let's shuffle the counter assignments around a bit so that the most
      recent updates when the AES instruction pair executes are 128-bit wide.
      
      [0] ARM-EPM-049219 v23 Cortex-A57 MPCore Software Developers Errata Notice
      [1] ARM-EPM-012079 v11.0 Cortex-A72 MPCore Software Developers Errata Notice
      
      Cc: <stable@vger.kernel.org> # v5.4+
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      f3456b9f
    • Ard Biesheuvel's avatar
      crypto: ecdh - avoid unaligned accesses in ecdh_set_secret() · 17858b14
      Ard Biesheuvel authored
      ecdh_set_secret() casts a void* pointer to a const u64* in order to
      feed it into ecc_is_key_valid(). This is not generally permitted by
      the C standard, and leads to actual misalignment faults on ARMv6
      cores. In some cases, these are fixed up in software, but this still
      leads to performance hits that are entirely avoidable.
      
      So let's copy the key into the ctx buffer first, which we will do
      anyway in the common case, and which guarantees correct alignment.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      17858b14
  2. 27 Nov, 2020 22 commits
  3. 20 Nov, 2020 13 commits
  4. 13 Nov, 2020 3 commits