Skip to content
Snippets Groups Projects
  1. Jul 11, 2009
    • Herbert Xu's avatar
      crypto: shash - Export/import hash state only · 99d27e1c
      Herbert Xu authored
      
      This patch replaces the full descriptor export with an export of
      the partial hash state.  This allows the use of a consistent export
      format across all implementations of a given algorithm.
      
      This is useful because a number of cases require the use of the
      partial hash state, e.g., PadLock can use the SHA1 hash state
      to get around the fact that it can only hash contiguous data
      chunks.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      99d27e1c
  2. Jul 09, 2009
  3. Jul 08, 2009
  4. Jul 07, 2009
  5. Jul 03, 2009
    • Sebastian Andrzej Siewior's avatar
      crypto: ansi_prng - alloc cipher just in init · fd09d7fa
      Sebastian Andrzej Siewior authored
      
      As reported by Eric Sesterhenn the re-allocation of the cipher in reset leads
      to:
      |BUG: sleeping function called from invalid context at kernel/rwsem.c:21
      |in_atomic(): 1, irqs_disabled(): 0, pid: 4926, name: modprobe
      |INFO: lockdep is turned off.
      |Pid: 4926, comm: modprobe Tainted: G   M 2.6.31-rc1-22297-g5298976 #24
      |Call Trace:
      | [<c011dd93>] __might_sleep+0xf9/0x101
      | [<c0777aa0>] down_read+0x16/0x68
      | [<c048bf04>] crypto_alg_lookup+0x16/0x34
      | [<c048bf52>] crypto_larval_lookup+0x30/0xf9
      | [<c048c038>] crypto_alg_mod_lookup+0x1d/0x62
      | [<c048c13e>] crypto_alloc_base+0x1e/0x64
      | [<c04bf991>] reset_prng_context+0xab/0x13f
      | [<c04e5cfc>] ? __spin_lock_init+0x27/0x51
      | [<c04bfce1>] cprng_init+0x2a/0x42
      | [<c048bb4c>] __crypto_alloc_tfm+0xfa/0x128
      | [<c048c153>] crypto_alloc_base+0x33/0x64
      | [<c04933c9>] alg_test_cprng+0x30/0x1f4
      | [<c0493329>] alg_test+0x12f/0x19f
      | [<c0177f1f>] ? __alloc_pages_nodemask+0x14d/0x481
      | [<d09219e2>] do_test+0xf9d/0x163f [tcrypt]
      | [<d0920de6>] do_test+0x3a1/0x163f [tcrypt]
      | [<d0926035>] tcrypt_mod_init+0x35/0x7c [tcrypt]
      | [<c010113c>] _stext+0x54/0x12c
      | [<d0926000>] ? tcrypt_mod_init+0x0/0x7c [tcrypt]
      | [<c01398a3>] ? up_read+0x16/0x2b
      | [<c0139fc4>] ? __blocking_notifier_call_chain+0x40/0x4c
      | [<c014ee8d>] sys_init_module+0xa9/0x1bf
      | [<c010292b>] sysenter_do_call+0x12/0x32
      
      because a spin lock is held and crypto_alloc_base() may sleep.
      There is no reason to re-allocate the cipher, the state is resetted in
      ->setkey(). This patches makes the cipher allocation a one time thing and
      moves it to init.
      
      Reported-by: default avatarEric Sesterhenn <eric.sesterhenn@lsexperts.de>
      Signed-off-by: default avatarSebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      fd09d7fa
    • Sebastian Andrzej Siewior's avatar
      crypto: ansi_prng - Use just a BH lock · ed940700
      Sebastian Andrzej Siewior authored
      
      The current code uses a mix of sping_lock() & spin_lock_irqsave(). This can
      lead to deadlock with the correct timming & cprng_get_random() + cprng_reset()
      sequence.
      I've converted them to bottom half locks since all three user grab just a BH
      lock so this runs probably in softirq :)
      
      Signed-off-by: default avatarSebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ed940700
  6. Jul 02, 2009
  7. Jun 25, 2009
    • Herbert Xu's avatar
      crypto: skcipher - Change default sync geniv on SMP to eseqiv · 0b67fb65
      Herbert Xu authored
      
      As it stands we use chainiv for sync algorithms and eseqiv for
      async algorithms.  However, when there is more than one CPU
      chainiv forces all processing to be serialised which is usually
      not what you want.  Also, the added overhead of eseqiv isn't that
      great.
      
      Therefore this patch changes the default sync geniv on SMP machines
      to eseqiv.  For the odd situation where the overhead is unacceptable
      then chainiv is still available as an option.
      
      Note that on UP machines chainiv is still preferred over eseqiv
      for sync algorithms.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      0b67fb65
    • Herbert Xu's avatar
      crypto: skcipher - Fix request for sync algorithms · 435578ae
      Herbert Xu authored
      
      When a sync givcipher algorithm is requested, if an async version
      of the same algorithm already exists, then we will loop forever
      without ever constructing the sync version based on a blkcipher.
      
      This is because we did not include the requested type/mask when
      getting a larval for the geniv algorithm that is to be constructed.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      435578ae
  8. Jun 24, 2009
  9. Jun 21, 2009
  10. Jun 19, 2009
  11. Jun 18, 2009
  12. Jun 15, 2009
  13. Jun 02, 2009
Loading