17 Aug, 2015

1 commit


14 Jul, 2015

1 commit


03 Jun, 2015

1 commit


25 May, 2015

1 commit


22 May, 2015

1 commit

  • As AEAD has switched over to using frontend types, the function
    crypto_init_spawn must not be used since it does not specify a
    frontend type. Otherwise it leads to a crash when the spawn is
    used.

    This patch fixes it by switching over to crypto_grab_aead instead.

    Fixes: 5d1d65f8bea6 ("crypto: aead - Convert top level interface to new style")
    Signed-off-by: Herbert Xu

    Herbert Xu
     

13 May, 2015

1 commit


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
     

05 Dec, 2013

1 commit

  • A kernel with enabled lockdep complains about the wrong usage of
    rcu_dereference() under a rcu_read_lock_bh() protected region.

    ===============================
    [ INFO: suspicious RCU usage. ]
    3.13.0-rc1+ #126 Not tainted
    -------------------------------
    linux/crypto/pcrypt.c:81 suspicious rcu_dereference_check() usage!

    other info that might help us debug this:

    rcu_scheduler_active = 1, debug_locks = 1
    1 lock held by cryptomgr_test/153:
    #0: (rcu_read_lock_bh){.+....}, at: [] pcrypt_do_parallel.isra.2+0x5/0x200

    Fix that by using rcu_dereference_bh() instead.

    Signed-off-by: Mathias Krause
    Cc: "David S. Miller"
    Acked-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Mathias Krause
     

04 Jul, 2013

1 commit

  • For the workqueue creation interfaces that do not expect format strings,
    make sure they cannot accidently be parsed that way. Additionally, clean
    up calls made with a single parameter that would be handled as a format
    string. Many callers are passing potentially dynamic string content, so
    use "%s" in those cases to avoid any potential accidents.

    Signed-off-by: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

29 Mar, 2012

1 commit

  • We use the active cpumask to determine the superset of cpus
    to use for parallelization. However, the active cpumask is
    for internal usage of the scheduler and therefore not the
    appropriate cpumask for these purposes. So use the online
    cpumask instead.

    Reported-by: Peter Zijlstra
    Signed-off-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Steffen Klassert
     

14 Jan, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (46 commits)
    hwrng: via_rng - Fix memory scribbling on some CPUs
    crypto: padlock - Move padlock.h into include/crypto
    hwrng: via_rng - Fix asm constraints
    crypto: n2 - use __devexit not __exit in n2_unregister_algs
    crypto: mark crypto workqueues CPU_INTENSIVE
    crypto: mv_cesa - dont return PTR_ERR() of wrong pointer
    crypto: ripemd - Set module author and update email address
    crypto: omap-sham - backlog handling fix
    crypto: gf128mul - Remove experimental tag
    crypto: af_alg - fix af_alg memory_allocated data type
    crypto: aesni-intel - Fixed build with binutils 2.16
    crypto: af_alg - Make sure sk_security is initialized on accept()ed sockets
    net: Add missing lockdep class names for af_alg
    include: Install linux/if_alg.h for user-space crypto API
    crypto: omap-aes - checkpatch --file warning fixes
    crypto: omap-aes - initialize aes module once per request
    crypto: omap-aes - unnecessary code removed
    crypto: omap-aes - error handling implementation improved
    crypto: omap-aes - redundant locking is removed
    crypto: omap-aes - DMA initialization fixes for OMAP off mode
    ...

    Linus Torvalds
     

04 Jan, 2011

1 commit

  • kcrypto_wq and pcrypt->wq's are used to run ciphers and may consume
    considerable amount of CPU cycles. Mark both as CPU_INTENSIVE so that
    they don't block other work items.

    As the workqueues are primarily used to burn CPU cycles, concurrency
    levels shouldn't matter much and are left at 1. A higher value may be
    beneficial and needs investigation.

    Signed-off-by: Tejun Heo
    Signed-off-by: Herbert Xu

    Tejun Heo
     

12 Nov, 2010

1 commit


31 Jul, 2010

3 commits

  • The padata cpumask change notifier passes a padata_cpumask to the
    notifier chain. So we use this cpumask instead of asking padata for
    the cpumask.

    Signed-off-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Steffen Klassert
     
  • In the crypto-layer an instance refers usually to a crypto instance.
    The struct pcrypt_instance is not related to a crypto instance.
    It rather contains the padata informations, so we rename it to
    padata_pcrypt. The functions that handle this struct are renamed
    accordingly.

    Signed-off-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Steffen Klassert
     
  • We rename padata_alloc to padata_alloc_possible because this
    function allocates a padata_instance and uses the cpu_possible
    mask for parallel and serial workers. Also we rename __padata_alloc
    to padata_alloc to avoid to export underlined functions. Underlined
    functions are considered to be private to padata. Users are updated
    accordingly.

    Signed-off-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Steffen Klassert
     

26 Jul, 2010

1 commit


19 Jul, 2010

2 commits

  • Added sysfs interface to pcrypt. Now pcrypt subsystem creates two
    sysfs directories with corresponding padata sysfs objects:
    /sys/kernel/pcrypt/[pencrypt|pdecrypt]

    Signed-off-by: Dan Kruchinin
    Signed-off-by: Herbert Xu

    Dan Kruchinin
     
  • The aim of this patch is to make two separate cpumasks
    for padata parallel and serial workers respectively.
    It allows user to make more thin and sophisticated configurations
    of padata framework. For example user may bind parallel and serial workers to non-intersecting
    CPU groups to gain better performance. Also each padata instance has notifiers chain for its
    cpumasks now. If either parallel or serial or both masks were changed all
    interested subsystems will get notification about that. It's especially useful
    if padata user uses algorithm for callback CPU selection according to serial cpumask.

    Signed-off-by: Dan Kruchinin
    Signed-off-by: Herbert Xu

    Dan Kruchinin
     

14 Jul, 2010

2 commits

  • To return -EINPROGRESS on success in padata_do_parallel was
    considered to be odd. This patch changes this to return zero
    on success. Also the only user of padata, pcrypt is adapted to
    convert a return of zero to -EINPROGRESS within the crypto layer.
    This also removes the pcrypt fallback if padata_do_parallel
    was called on a not running padata instance as we can't handle it
    anymore. This fallback was unused, so it's save to remove it.

    Signed-off-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Steffen Klassert
     
  • This patch introduces the PADATA_INVALID flag which is
    checked on padata start. This will be used to mark a padata
    instance as invalid, if the padata cpumask does not intersect
    with the active cpumask. we change padata_start to return an
    error if the PADATA_INVALID is set. Also we adapt the only
    padata user, pcrypt to this change.

    Signed-off-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Steffen Klassert
     

24 Mar, 2010

1 commit

  • I was concerned about the error handling for crypto_get_attr_type() in
    pcrypt_alloc_aead(). Steffen Klassert pointed out that we could simply
    avoid calling crypto_get_attr_type() if we passed the type and mask as a
    parameters.

    Signed-off-by: Dan Carpenter
    Acked-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Dan Carpenter
     

04 Feb, 2010

1 commit


07 Jan, 2010

1 commit