1. 09 8月, 2016 4 次提交
  2. 28 7月, 2016 1 次提交
  3. 23 6月, 2016 6 次提交
  4. 05 4月, 2016 1 次提交
  5. 17 3月, 2016 2 次提交
    • B
      crypto: marvell/cesa - initialize hash states · b0ef5106
      Boris BREZILLON 提交于
      ->export() might be called before we have done an update operation,
      and in this case the ->state field is left uninitialized.
      Put the correct default value when initializing the request.
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      b0ef5106
    • B
      crypto: marvell/cesa - fix memory leak · 7850c91b
      Boris BREZILLON 提交于
      Crypto requests are not guaranteed to be finalized (->final() call),
      and can be freed at any moment, without getting any notification from
      the core. This can lead to memory leaks of the ->cache buffer.
      
      Make this buffer part of the request object, and allocate an extra buffer
      from the DMA cache pool when doing DMA operations.
      
      As a side effect, this patch also fixes another bug related to cache
      allocation and DMA operations. When the core allocates a new request and
      import an existing state, a cache buffer can be allocated (depending
      on the state). The problem is, at that very moment, we don't know yet
      whether the request will use DMA or not, and since everything is
      likely to be initialized to zero, mv_cesa_ahash_alloc_cache() thinks it
      should allocate a buffer for standard operation. But when
      mv_cesa_ahash_free_cache() is called, req->type has been set to
      CESA_DMA_REQ in the meantime, thus leading to an invalind dma_pool_free()
      call (the buffer passed in argument has not been allocated from the pool).
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Reported-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7850c91b
  6. 17 11月, 2015 1 次提交
  7. 20 10月, 2015 19 次提交
  8. 14 10月, 2015 4 次提交
  9. 21 9月, 2015 1 次提交
    • T
      crypto: marvell - properly handle CRYPTO_TFM_REQ_MAY_BACKLOG-flagged requests · cfcd2271
      Thomas Petazzoni 提交于
      The mv_cesa_queue_req() function calls crypto_enqueue_request() to
      enqueue a request. In the normal case (i.e the queue isn't full), this
      function returns -EINPROGRESS. The current Marvell CESA crypto driver
      takes this into account and cleans up the request only if an error
      occured, i.e if the return value is not -EINPROGRESS.
      
      Unfortunately this causes problems with
      CRYPTO_TFM_REQ_MAY_BACKLOG-flagged requests. When such a request is
      passed to crypto_enqueue_request() and the queue is full,
      crypto_enqueue_request() will return -EBUSY, but will keep the request
      enqueued nonetheless. This situation was not properly handled by the
      Marvell CESA driver, which was anyway cleaning up the request in such
      a situation. When later on the request was taken out of the backlog
      and actually processed, a kernel crash occured due to the internal
      driver data structures for this structure having been cleaned up.
      
      To avoid this situation, this commit adds a
      mv_cesa_req_needs_cleanup() helper function which indicates if the
      request needs to be cleaned up or not after a call to
      crypto_enqueue_request(). This helper allows to do the cleanup only in
      the appropriate cases, and all call sites of mv_cesa_queue_req() are
      fixed to use this new helper function.
      Reported-by: NVincent Donnefort <vdonnefort@gmail.com>
      Fixes: db509a45 ("crypto: marvell/cesa - add TDMA support")
      Cc: <stable@vger.kernel.org> # v4.2+
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Tested-by: NVincent Donnefort <vdonnefort@gmail.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      cfcd2271
  10. 19 6月, 2015 1 次提交