22 Jun, 2015

1 commit

  • The RNG may not be available during early boot, e.g., the relevant
    modules may not be included in the initramfs. As the RNG Is only
    needed for IPsec, we should not let this prevent use of ciphers
    without IV generators, e.g., for disk encryption.

    This patch postpones the RNG allocation to the init function so
    that one failure during early boot does not make the RNG unavailable
    for all subsequent users of the same cipher.

    More importantly, it lets the cipher live even if RNG allocation
    fails. Of course we no longer offer IV generation and which will
    fail with an error if invoked. But all other cipher capabilities
    will function as usual.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

04 Jun, 2015

1 commit

  • We currently do the IV seeding on the first givencrypt call in
    order to conserve entropy. However, this does not work with
    DRBG which cannot be called from interrupt context. In fact,
    with DRBG we don't need to conserve entropy anyway. So this
    patch moves the seeding into the init function.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

26 Nov, 2014

1 commit

  • This adds the module loading prefix "crypto-" to the template lookup
    as well.

    For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly
    includes the "crypto-" prefix at every level, correctly rejecting "vfat":

    net-pf-38
    algif-hash
    crypto-vfat(blowfish)
    crypto-vfat(blowfish)-all
    crypto-vfat

    Reported-by: Mathias Krause
    Signed-off-by: Kees Cook
    Acked-by: Mathias Krause
    Signed-off-by: Herbert Xu

    Kees Cook
     

18 Apr, 2014

1 commit

  • Mostly scripted conversion of the smp_mb__* barriers.

    Signed-off-by: Peter Zijlstra
    Acked-by: Paul E. McKenney
    Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
    Cc: Linus Torvalds
    Cc: linux-arch@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

04 Feb, 2013

1 commit

  • Replace PTR_ERR followed by ERR_PTR by ERR_CAST, to be more concise.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression err,x;
    @@
    - err = PTR_ERR(x);
    if (IS_ERR(x))
    - return ERR_PTR(err);
    + return ERR_CAST(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Herbert Xu

    Julia Lawall
     

19 Feb, 2009

1 commit


29 Aug, 2008

2 commits


10 Jul, 2008

1 commit


08 Mar, 2008

1 commit


23 Feb, 2008

1 commit


11 Jan, 2008

2 commits

  • This patch makes chainiv avoid spinning by postponing requests on lock
    contention if the user allows the use of asynchronous algorithms. If
    a synchronous algorithm is requested then we behave as before.

    This should improve IPsec performance on SMP when two CPUs attempt to
    transmit over the same SA. Currently one of them will spin doing nothing
    waiting for the other CPU to finish its encryption. This patch makes it
    postpone the request and get on with other work.

    If only one CPU is transmitting for a given SA, then we will process
    the request synchronously as before.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • The chain IV generator is the one we've been using in the IPsec stack.
    It simply starts out with a random IV, then uses the last block of each
    encrypted packet's cipher text as the IV for the next packet.

    It can only be used by synchronous ciphers since we have to make sure
    that we don't start the encryption of the next packet until the last
    one has completed.

    It does have the advantage of using very little CPU time since it doesn't
    have to generate anything at all.

    Signed-off-by: Herbert Xu

    Herbert Xu