1. 24 May, 2023 1 commit
    • Ard Biesheuvel's avatar
      crypto: x86/aria - Use 16 byte alignment for GFNI constant vectors · 6ab39f99
      Ard Biesheuvel authored
      The GFNI routines in the AVX version of the ARIA implementation now use
      explicit VMOVDQA instructions to load the constant input vectors, which
      means they must be 16 byte aligned. So ensure that this is the case, by
      dropping the section split and the incorrect .align 8 directive, and
      emitting the constants into the 16-byte aligned section instead.
      
      Note that the AVX2 version of this code deviates from this pattern, and
      does not require a similar fix, given that it loads these contants as
      8-byte memory operands, for which AVX2 permits any alignment.
      
      Cc: Taehee Yoo <ap420073@gmail.com>
      Fixes: 8b844753 ("crypto: x86/aria-avx - Do not use avx2 instructions")
      Reported-by: syzbot+a6abcf08bad8b18fd198@syzkaller.appspotmail.com
      Tested-by: syzbot+a6abcf08bad8b18fd198@syzkaller.appspotmail.com
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      6ab39f99
  2. 02 May, 2023 1 commit
  3. 28 Apr, 2023 2 commits
    • Olivier Bacon's avatar
      crypto: engine - fix crypto_queue backlog handling · 4140aafc
      Olivier Bacon authored
      CRYPTO_TFM_REQ_MAY_BACKLOG tells the crypto driver that it should
      internally backlog requests until the crypto hw's queue becomes
      full. At that point, crypto_engine backlogs the request and returns
      -EBUSY. Calling driver such as dm-crypt then waits until the
      complete() function is called with a status of -EINPROGRESS before
      sending a new request.
      
      The problem lies in the call to complete() with a value of -EINPROGRESS
      that is made when a backlog item is present on the queue. The call is
      done before the successful execution of the crypto request. In the case
      that do_one_request() returns < 0 and the retry support is available,
      the request is put back in the queue. This leads upper drivers to send
      a new request even if the queue is still full.
      
      The problem can be reproduced by doing a large dd into a crypto
      dm-crypt device. This is pretty easy to see when using
      Freescale CAAM crypto driver and SWIOTLB dma. Since the actual amount
      of requests that can be hold in the queue is unlimited we get IOs error
      and dma allocation.
      
      The fix is to call complete with a value of -EINPROGRESS only if
      the request is not enqueued back in crypto_queue. This is done
      by calling complete() later in the code. In order to delay the decision,
      crypto_queue is modified to correctly set the backlog pointer
      when a request is enqueued back.
      
      Fixes: 6a89f492 ("crypto: engine - support for parallel requests based on retry mechanism")
      Co-developed-by: default avatarSylvain Ouellet <souellet@genetec.com>
      Signed-off-by: default avatarSylvain Ouellet <souellet@genetec.com>
      Signed-off-by: default avatarOlivier Bacon <obacon@genetec.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      4140aafc
    • Christophe JAILLET's avatar
      crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs() · 8fd91151
      Christophe JAILLET authored
      SS_ENCRYPTION is (0 << 7 = 0), so the test can never be true.
      Use a direct comparison to SS_ENCRYPTION instead.
      
      The same king of test is already done the same way in sun8i_ss_run_task().
      
      Fixes: 359e893e ("crypto: sun8i-ss - rework handling of IV")
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      8fd91151
  4. 20 Apr, 2023 24 commits
  5. 14 Apr, 2023 9 commits
  6. 11 Apr, 2023 1 commit
  7. 06 Apr, 2023 2 commits