22 Jul, 2018

2 commits

  • commit 5d59ad6eea82ef8df92b4109615a0dde9d8093e9 upstream.

    If one of the later memory allocations in rypto4xx_build_pdr()
    fails: dev->pdr (and/or) dev->pdr_uinfo wouldn't be freed.

    crypto4xx_build_sdr() has the same issue with dev->sdr.

    Signed-off-by: Christian Lamparter
    Signed-off-by: Herbert Xu
    Signed-off-by: Amit Pundir
    Signed-off-by: Greg Kroah-Hartman

    Christian Lamparter
     
  • commit a728a196d253530f17da5c86dc7dfbe58c5f7094 upstream.

    alg entries are only added to the list, after the registration
    was successful. If the registration failed, it was never added
    to the list in the first place.

    Signed-off-by: Christian Lamparter
    Signed-off-by: Herbert Xu
    Signed-off-by: Amit Pundir
    Signed-off-by: Greg Kroah-Hartman

    Christian Lamparter
     

25 Dec, 2017

1 commit

  • [ Upstream commit 778f81d6cdb7d25360f082ac0384d5103f04eca5 ]

    If crypto4xx is used in conjunction with dm-crypt, the available
    ring buffer elements are not enough to handle the load properly.

    On an aes-cbc-essiv:sha256 encrypted swap partition the read
    performance is abyssal: (tested with hdparm -t)

    /dev/mapper/swap_crypt:
    Timing buffered disk reads: 14 MB in 3.68 seconds = 3.81 MB/sec

    The patch increases both PPC4XX_NUM_SD and PPC4XX_NUM_PD to 256.
    This improves the performance considerably:

    /dev/mapper/swap_crypt:
    Timing buffered disk reads: 104 MB in 3.03 seconds = 34.31 MB/sec

    Furthermore, PPC4XX_LAST_SD, PPC4XX_LAST_GD and PPC4XX_LAST_PD
    can be easily calculated from their respective PPC4XX_NUM_*
    constant.

    Signed-off-by: Christian Lamparter
    Signed-off-by: Herbert Xu
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Christian Lamparter
     

20 Jun, 2017

1 commit


24 Apr, 2017

1 commit


21 Oct, 2016

1 commit

  • The size used in 'dma_free_coherent()' looks un-initialized here.
    ctx->sa_len is set a few lines below and is apparently not set by the
    caller.
    So use 'size' as in the corresponding 'dma_alloc_coherent()' a few lines
    above.

    This has been spotted with coccinelle, using the following script:
    ////////////////////
    @r@
    expression x0, x1, y0, y1, z0, z1, t0, t1, ret;
    @@

    * ret = dma_alloc_coherent(x0, y0, z0, t0);
    ...
    * dma_free_coherent(x1, y1, ret, t1);

    @script:python@
    y0 << r.y0;
    y1 << r.y1;

    @@
    if y1.find(y0) == -1:
    print "WARNING: sizes look different: '%s' vs '%s'" % (y0, y1)
    ////////////////////

    Signed-off-by: Christophe JAILLET
    Signed-off-by: Herbert Xu

    Christophe Jaillet
     

20 Apr, 2016

1 commit


17 Nov, 2015

1 commit


21 Sep, 2015

2 commits


17 Aug, 2015

1 commit


11 Mar, 2015

1 commit

  • Even if bus is not hot-pluggable, the devices can be bound and unbound
    from the driver via sysfs, so we should not be using __init/__exit
    annotations on probe() and remove() methods. The only exception is
    drivers registered with platform_driver_probe() which specifically
    disables sysfs bind/unbind attributes.

    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Herbert Xu

    Dmitry Torokhov
     

05 Jan, 2015

1 commit


20 Oct, 2014

1 commit


20 Jun, 2014

1 commit


30 Dec, 2013

1 commit


11 Nov, 2013

1 commit

  • Commit b5b4bb3f6a11f9 (of: only include prom.h on sparc) removed implicit
    includes of of_*.h headers by powerpc's prom.h. Some components were
    missed in initial clean-up patch, so add the necessary includes to fix
    powerpc builds.

    Signed-off-by: Rob Herring
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Tejun Heo
    Cc: Matt Mackall
    Cc: Herbert Xu
    Cc: "David S. Miller"
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: linux-ide@vger.kernel.org
    Cc: linux-crypto@vger.kernel.org

    Rob Herring
     

14 Aug, 2013

1 commit

  • These local symbols are used only in this file.
    Fix the following sparse warnings:

    drivers/crypto/amcc/crypto4xx_alg.c:35:6: warning: symbol 'set_dynamic_sa_command_0' was not declared. Should it be static?
    drivers/crypto/amcc/crypto4xx_alg.c:55:6: warning: symbol 'set_dynamic_sa_command_1' was not declared. Should it be static?

    Signed-off-by: Jingoo Han
    Signed-off-by: Herbert Xu

    Jingoo Han
     

27 Sep, 2012

1 commit

  • Convert a nonnegative error return code to a negative one, as returned
    elsewhere in the function.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    (
    if@p1 (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret@p1 = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Herbert Xu

    Peter Senna Tschudin
     

27 Apr, 2012

1 commit


30 Nov, 2011

1 commit

  • This patch converts the drivers in drivers/crypto/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Cc: James Hsiao
    Cc: Sebastian Andrzej Siewior
    Cc: Kim Phillips
    Cc: "David S. Miller"
    Signed-off-by: Axel Lin
    Acked-by: Vladimir Zapolskiy
    Acked-by: Jamie Iles
    Signed-off-by: Herbert Xu

    Axel Lin
     

30 Jun, 2011

1 commit

  • The Security function on the AMCC SoCs has multiple engines within a
    single MMIO range. The crypto driver currently enables the 3DES
    functionality by doing a blind write to the device control register.
    This can unintentionally disable other functions like the PKA or TRNG
    when the driver is loaded.

    Perform a read/modify/write to enable the 3DES function instead.

    Signed-off-by: Josh Boyer
    Signed-off-by: Herbert Xu

    Josh Boyer
     

31 Mar, 2011

1 commit


28 Feb, 2011

1 commit


25 Oct, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: Makefile - replace the use of -objs with -y
    crypto: hifn_795x - use cancel_delayed_work_sync()
    crypto: talitos - sparse check endian fixes
    crypto: talitos - fix checkpatch warning
    crypto: talitos - fix warning: 'alg' may be used uninitialized in this function
    crypto: cryptd - Adding the AEAD interface type support to cryptd
    crypto: n2_crypto - Niagara2 driver needs to depend upon CRYPTO_DES
    crypto: Kconfig - update broken web addresses
    crypto: omap-sham - Adjust DMA parameters
    crypto: fips - FIPS requires algorithm self-tests
    crypto: omap-aes - OMAP2/3 AES hw accelerator driver
    crypto: updates to enable omap aes
    padata: add missing __percpu markup in include/linux/padata.h
    MAINTAINERS: Add maintainer entries for padata/pcrypt

    Linus Torvalds
     

19 Oct, 2010

1 commit


06 Aug, 2010

1 commit

  • of_device is just an alias for platform_device, so remove it entirely. Also
    replace to_of_device() with to_platform_device() and update comment blocks.

    This patch was initially generated from the following semantic patch, and then
    edited by hand to pick up the bits that coccinelle didn't catch.

    @@
    @@
    -struct of_device
    +struct platform_device

    Signed-off-by: Grant Likely
    Reviewed-by: David S. Miller

    Grant Likely
     

17 Jun, 2010

2 commits


03 Jun, 2010

1 commit


22 May, 2010

1 commit

  • .name, .match_table and .owner are duplicated in both of_platform_driver
    and device_driver. This patch is a removes the extra copies from struct
    of_platform_driver and converts all users to the device_driver members.

    This patch is a pretty mechanical change. The usage model doesn't change
    and if any drivers have been missed, or if anything has been fixed up
    incorrectly, then it will fail with a compile time error, and the fixup
    will be trivial. This patch looks big and scary because it touches so
    many files, but it should be pretty safe.

    Signed-off-by: Grant Likely
    Acked-by: Sean MacLennan

    Grant Likely
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

17 Jan, 2010

1 commit

  • From: Márton Németh

    The match_table field of the struct of_device_id is constant in
    so it is worth to make the initialization data also constant.

    The semantic match that finds this kind of pattern is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    disable decl_init,const_decl_init;
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Márton Németh
    Cc: Julia Lawall
    Cc: cocci@diku.dk
    Signed-off-by: Herbert Xu

    Márton Németh
     

15 Jul, 2009

1 commit


14 Jul, 2009

2 commits


18 Feb, 2009

1 commit

  • This patch adds support for AMCC ppc4xx security device driver. This is the
    initial release that includes the driver framework with AES and SHA1 algorithms
    support.

    The remaining algorithms will be released in the near future.

    Signed-off-by: James Hsiao
    Signed-off-by: Herbert Xu

    James Hsiao