1. 22 12月, 2014 2 次提交
    • J
      crypto: af_alg - fixed style error in af_alg.c · 267c4221
      Joshua I. James 提交于
      Fixed style error identified by checkpatch.
      
      ERROR: space required before the open parenthesis '('
      +               switch(cmsg->cmsg_type) {
      Signed-off-by: NJoshua I. James <joshua@cybercrimetech.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      267c4221
    • R
      crypto: af_alg - fix backlog handling · 7e77bdeb
      Rabin Vincent 提交于
      If a request is backlogged, it's complete() handler will get called
      twice: once with -EINPROGRESS, and once with the final error code.
      
      af_alg's complete handler, unlike other users, does not handle the
      -EINPROGRESS but instead always completes the completion that recvmsg()
      is waiting on.  This can lead to a return to user space while the
      request is still pending in the driver.  If userspace closes the sockets
      before the requests are handled by the driver, this will lead to
      use-after-frees (and potential crashes) in the kernel due to the tfm
      having been freed.
      
      The crashes can be easily reproduced (for example) by reducing the max
      queue length in cryptod.c and running the following (from
      http://www.chronox.de/libkcapi.html) on AES-NI capable hardware:
      
       $ while true; do kcapi -x 1 -e -c '__ecb-aes-aesni' \
          -k 00000000000000000000000000000000 \
          -p 00000000000000000000000000000000 >/dev/null & done
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NRabin Vincent <rabin.vincent@axis.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7e77bdeb
  2. 11 12月, 2014 1 次提交
  3. 05 12月, 2014 1 次提交
  4. 31 7月, 2014 1 次提交
  5. 15 11月, 2013 1 次提交
  6. 27 7月, 2011 1 次提交
  7. 21 12月, 2010 1 次提交
  8. 08 12月, 2010 1 次提交
  9. 19 11月, 2010 1 次提交
    • H
      crypto: af_alg - User-space interface for Crypto API · 03c8efc1
      Herbert Xu 提交于
      This patch creates the backbone of the user-space interface for
      the Crypto API, through a new socket family AF_ALG.
      
      Each session corresponds to one or more connections obtained from
      that socket.  The number depends on the number of inputs/outputs
      of that particular type of operation.  For most types there will
      be a s ingle connection/file descriptor that is used for both input
      and output.  AEAD is one of the few that require two inputs.
      
      Each algorithm type will provide its own implementation that plugs
      into af_alg.  They're keyed using a string such as "skcipher" or
      "hash".
      
      IOW this patch only contains the boring bits that is required
      to hold everything together.
      
      Thakns to Miloslav Trmac for reviewing this and contributing
      fixes and improvements.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Tested-by: NMartin Willi <martin@strongswan.org>
      03c8efc1