1. 08 Feb, 2018 1 commit
    • Eric Biggers's avatar
      crypto: sha512-mb - initialize pending lengths correctly · eff84b37
      Eric Biggers authored
      The SHA-512 multibuffer code keeps track of the number of blocks pending
      in each lane.  The minimum of these values is used to identify the next
      lane that will be completed.  Unused lanes are set to a large number
      (0xFFFFFFFF) so that they don't affect this calculation.
      
      However, it was forgotten to set the lengths to this value in the
      initial state, where all lanes are unused.  As a result it was possible
      for sha512_mb_mgr_get_comp_job_avx2() to select an unused lane, causing
      a NULL pointer dereference.  Specifically this could happen in the case
      where ->update() was passed fewer than SHA512_BLOCK_SIZE bytes of data,
      so it then called sha_complete_job() without having actually submitted
      any blocks to the multi-buffer code.  This hit a NULL pointer
      dereference if another task happened to have submitted blocks
      concurrently to the same CPU and the flush timer had not yet expired.
      
      Fix this by initializing sha512_mb_mgr->lens correctly.
      
      As usual, this bug was found by syzkaller.
      
      Fixes: 45691e2d ("crypto: sha512-mb - submit/flush routines for AVX2")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: <stable@vger.kernel.org> # v4.8+
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      eff84b37
  2. 25 Jan, 2018 16 commits
  3. 20 Jan, 2018 1 commit
  4. 19 Jan, 2018 1 commit
  5. 18 Jan, 2018 19 commits
  6. 14 Jan, 2018 1 commit
  7. 12 Jan, 2018 1 commit
    • tcharding's avatar
      crypto: doc - clear htmldocs build warnings for crypto/hash · b40fa82c
      tcharding authored
      SPHINX build emits multiple warnings of kind:
      
      	warning: duplicate section name 'Note'
      
      (when building kernel via make target 'htmldocs')
      
      This is caused by repeated use of comments of form:
      
      	* Note: soau soaeusoa uoe
      
      We can change the format without loss of clarity and clear the build
      warnings.
      
      Add '**[mandatory]**' or '**[optional]**' as kernel-doc field element
      description prefix
      
      This renders in HTML as (prefixes in bold)
      
      final
          [mandatory] Retrieve result from the driver. This function finalizes the
          transformation and retrieves the resulting hash from the driver and
          pushes it back to upper layers. No data processing happens at this
          point unless hardware requires it to finish the transformation (then
          the data buffered by the device driver is processed).
      Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      b40fa82c