09 Jul, 2018

1 commit

  • Some crypto API users allocating a tfm with crypto_alloc_$FOO() are also
    specifying the type flags for $FOO, e.g. crypto_alloc_shash() with
    CRYPTO_ALG_TYPE_SHASH. But, that's redundant since the crypto API will
    override any specified type flag/mask with the correct ones.

    So, remove the unneeded flags.

    This patch shouldn't change any actual behavior.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     

15 Jun, 2018

1 commit


08 May, 2018

1 commit


31 Mar, 2018

1 commit

  • Add a note that it is perfectly legal to "abandon" a request object:
    - call .init() and then (as many times) .update()
    - _not_ call any of .final(), .finup() or .export() at any point in
    future

    Link: https://lkml.kernel.org/r/20180222114741.GA27631@gondor.apana.org.au
    Signed-off-by: Horia Geantă
    Signed-off-by: Herbert Xu

    Horia Geantă
     

15 Feb, 2018

1 commit


03 Nov, 2017

1 commit

  • The code sample is waiting for an async. crypto op completion.
    Adapt sample to use the new generic infrastructure to do the same.

    This also fixes a possible data coruption bug created by the
    use of wait_for_completion_interruptible() without dealing
    correctly with an interrupt aborting the wait prior to the
    async op finishing.

    Signed-off-by: Gilad Ben-Yossef
    Signed-off-by: Herbert Xu

    Gilad Ben-Yossef
     

14 Jul, 2017

1 commit


06 Jul, 2017

1 commit

  • Pull crypto updates from Herbert Xu:
    "Algorithms:
    - add private key generation to ecdh

    Drivers:
    - add generic gcm(aes) to aesni-intel
    - add SafeXcel EIP197 crypto engine driver
    - add ecb(aes), cfb(aes) and ecb(des3_ede) to cavium
    - add support for CNN55XX adapters in cavium
    - add ctr mode to chcr
    - add support for gcm(aes) to omap"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (140 commits)
    crypto: testmgr - Reenable sha1/aes in FIPS mode
    crypto: ccp - Release locks before returning
    crypto: cavium/nitrox - dma_mapping_error() returns bool
    crypto: doc - fix typo in docs
    Documentation/bindings: Document the SafeXel cryptographic engine driver
    crypto: caam - fix gfp allocation flags (part II)
    crypto: caam - fix gfp allocation flags (part I)
    crypto: drbg - Fixes panic in wait_for_completion call
    crypto: caam - make of_device_ids const.
    crypto: vmx - remove unnecessary check
    crypto: n2 - make of_device_ids const
    crypto: inside-secure - use the base_end pointer in ring rollback
    crypto: inside-secure - increase the batch size
    crypto: inside-secure - only dequeue when needed
    crypto: inside-secure - get the backlog before dequeueing the request
    crypto: inside-secure - stop requeueing failed requests
    crypto: inside-secure - use one queue per hw ring
    crypto: inside-secure - update the context and request later
    crypto: inside-secure - align the cipher and hash send functions
    crypto: inside-secure - optimize DSE bufferability control
    ...

    Linus Torvalds
     

22 Jun, 2017

1 commit


19 Jun, 2017

1 commit


19 May, 2017

2 commits

  • Mauro says:

    This patch series convert the remaining DocBooks to ReST.

    The first version was originally
    send as 3 patch series:

    [PATCH 00/36] Convert DocBook documents to ReST
    [PATCH 0/5] Convert more books to ReST
    [PATCH 00/13] Get rid of DocBook

    The lsm book was added as if it were a text file under
    Documentation. The plan is to merge it with another file
    under Documentation/security, after both this series and
    a security Documentation patch series gets merged.

    It also adjusts some Sphinx-pedantic errors/warnings on
    some kernel-doc markups.

    I also added some patches here to add PDF output for all
    existing ReST books.

    Jonathan Corbet
     
  • This creates a new section in the security development index for kernel
    keys, and adjusts for ReST markup.

    Cc: David Howells
    Signed-off-by: Kees Cook
    Signed-off-by: Jonathan Corbet

    Kees Cook
     

16 May, 2017

1 commit


03 May, 2017

1 commit

  • Pull security subsystem updates from James Morris:
    "Highlights:

    IMA:
    - provide ">" and " of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (98 commits)
    tpm: Fix reference count to main device
    tpm_tis: convert to using locality callbacks
    tpm: fix handling of the TPM 2.0 event logs
    tpm_crb: remove a cruft constant
    keys: select CONFIG_CRYPTO when selecting DH / KDF
    apparmor: Make path_max parameter readonly
    apparmor: fix parameters so that the permission test is bypassed at boot
    apparmor: fix invalid reference to index variable of iterator line 836
    apparmor: use SHASH_DESC_ON_STACK
    security/apparmor/lsm.c: set debug messages
    apparmor: fix boolreturn.cocci warnings
    Smack: Use GFP_KERNEL for smk_netlbl_mls().
    smack: fix double free in smack_parse_opts_str()
    KEYS: add SP800-56A KDF support for DH
    KEYS: Keyring asymmetric key restrict method with chaining
    KEYS: Restrict asymmetric key linkage using a specific keychain
    KEYS: Add a lookup_restriction function for the asymmetric key type
    KEYS: Add KEYCTL_RESTRICT_KEYRING
    KEYS: Consistent ordering for __key_link_begin and restrict check
    KEYS: Add an optional lookup_restriction hook to key_type
    ...

    Linus Torvalds
     

05 Apr, 2017

3 commits


16 Mar, 2017

1 commit


15 Feb, 2017

1 commit


03 Feb, 2017

1 commit


18 Dec, 2016

1 commit

  • Pull more documentation updates from Jonathan Corbet:
    "This converts the crypto DocBook to Sphinx"

    * tag 'docs-4.10-2' of git://git.lwn.net/linux:
    crypto: doc - optimize compilation
    crypto: doc - clarify AEAD memory structure
    crypto: doc - remove crypto_alloc_ablkcipher
    crypto: doc - add KPP documentation
    crypto: doc - fix separation of cipher / req API
    crypto: doc - fix source comments for Sphinx
    crypto: doc - remove crypto API DocBook
    crypto: doc - convert crypto API documentation to Sphinx

    Linus Torvalds
     

14 Dec, 2016

5 commits


01 Dec, 2016

2 commits


31 May, 2016

1 commit


06 Feb, 2016

1 commit


21 Oct, 2015

1 commit

  • Merge the type-specific data with the payload data into one four-word chunk
    as it seems pointless to keep them separate.

    Use user_key_payload() for accessing the payloads of overloaded
    user-defined keys.

    Signed-off-by: David Howells
    cc: linux-cifs@vger.kernel.org
    cc: ecryptfs@vger.kernel.org
    cc: linux-ext4@vger.kernel.org
    cc: linux-f2fs-devel@lists.sourceforge.net
    cc: linux-nfs@vger.kernel.org
    cc: ceph-devel@vger.kernel.org
    cc: linux-ima-devel@lists.sourceforge.net

    David Howells
     

09 Mar, 2015

1 commit

  • The patch moves the information provided in
    Documentation/crypto/crypto-API-userspace.txt into a separate chapter in
    the kernel crypto API DocBook. Some corrections are applied (such as
    removing a reference to Netlink when the AF_ALG socket is referred to).

    In addition, the AEAD and RNG interface description is now added.

    Also, a brief description of the zero-copy interface with an example
    code snippet is provided.

    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Stephan Mueller
     

13 Nov, 2014

1 commit

  • The userspace interface of the kernel crypto API is documented with
    * a general explanation
    * a discussion of the memory in-place operation
    * the description of the message digest API
    * the description of the symmetric cipher API

    The documentation refers to libkcapi as a working example on how to use
    the kernel crypto API from user space.

    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Stephan Mueller
     

04 Jul, 2013

1 commit

  • There have never been any real users of MEMSET operations since they
    have been introduced in January 2007 by commit 7405f74badf4 ("dmaengine:
    refactor dmaengine around dma_async_tx_descriptor"). Therefore remove
    support for them for now, it can be always brought back when needed.

    [sebastian.hesselbarth@gmail.com: fix drivers/dma/mv_xor]
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Sebastian Hesselbarth
    Cc: Vinod Koul
    Acked-by: Dan Williams
    Cc: Tomasz Figa
    Cc: Herbert Xu
    Cc: Olof Johansson
    Cc: Kevin Hilman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bartlomiej Zolnierkiewicz
     

08 Oct, 2012

1 commit


30 Aug, 2009

2 commits

  • async_raid6_2data_recov() recovers two data disk failures

    async_raid6_datap_recov() recovers a data disk and the P disk

    These routines are a port of the synchronous versions found in
    drivers/md/raid6recov.c. The primary difference is breaking out the xor
    operations into separate calls to async_xor. Two helper routines are
    introduced to perform scalar multiplication where needed.
    async_sum_product() multiplies two sources by scalar coefficients and
    then sums (xor) the result. async_mult() simply multiplies a single
    source by a scalar.

    This implemention also includes, in contrast to the original
    synchronous-only code, special case handling for the 4-disk and 5-disk
    array cases. In these situations the default N-disk algorithm will
    present 0-source or 1-source operations to dma devices. To cover for
    dma devices where the minimum source count is 2 we implement 4-disk and
    5-disk handling in the recovery code.

    [ Impact: asynchronous raid6 recovery routines for 2data and datap cases ]

    Cc: Yuri Tikhonov
    Cc: Ilya Yanok
    Cc: H. Peter Anvin
    Cc: David Woodhouse
    Reviewed-by: Andre Noll
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams
     
  • [ Based on an original patch by Yuri Tikhonov ]

    This adds support for doing asynchronous GF multiplication by adding
    two additional functions to the async_tx API:

    async_gen_syndrome() does simultaneous XOR and Galois field
    multiplication of sources.

    async_syndrome_val() validates the given source buffers against known P
    and Q values.

    When a request is made to run async_pq against more than the hardware
    maximum number of supported sources we need to reuse the previous
    generated P and Q values as sources into the next operation. Care must
    be taken to remove Q from P' and P from Q'. For example to perform a 5
    source pq op with hardware that only supports 4 sources at a time the
    following approach is taken:

    p, q = PQ(src0, src1, src2, src3, COEF({01}, {02}, {04}, {08}))
    p', q' = PQ(p, q, q, src4, COEF({00}, {01}, {00}, {10}))

    p' = p + q + q + src4 = p + src4
    q' = {00}*p + {01}*q + {00}*q + {10}*src4 = q + {10}*src4

    Note: 4 is the minimum acceptable maxpq otherwise we punt to
    synchronous-software path.

    The DMA_PREP_CONTINUE flag indicates to the driver to reuse p and q as
    sources (in the above manner) and fill the remaining slots up to maxpq
    with the new sources/coefficients.

    Note1: Some devices have native support for P+Q continuation and can skip
    this extra work. Devices with this capability can advertise it with
    dma_set_maxpq. It is up to each driver how to handle the
    DMA_PREP_CONTINUE flag.

    Note2: The api supports disabling the generation of P when generating Q,
    this is ignored by the synchronous path but is implemented by some dma
    devices to save unnecessary writes. In this case the continuation
    algorithm is simplified to only reuse Q as a source.

    Cc: H. Peter Anvin
    Cc: David Woodhouse
    Signed-off-by: Yuri Tikhonov
    Signed-off-by: Ilya Yanok
    Reviewed-by: Andre Noll
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams
     

04 Jun, 2009

3 commits

  • async_xor() needs space to perform dma and page address conversions. In
    most cases the code can simply reuse the struct page * array because the
    size of the native pointer matches the size of a dma/page address. In
    order to support archs where sizeof(dma_addr_t) is larger than
    sizeof(struct page *), or to preserve the input parameters, we utilize a
    memory region passed in by the caller.

    Since the code is now prepared to handle the case where it cannot
    perform address conversions on the stack, we no longer need the
    !HIGHMEM64G dependency in drivers/dma/Kconfig.

    [ Impact: don't clobber input buffers for address conversions ]

    Reviewed-by: Andre Noll
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Prepare the api for the arrival of a new parameter, 'scribble'. This
    will allow callers to identify scratchpad memory for dma address or page
    address conversions. As this adds yet another parameter, take this
    opportunity to convert the common submission parameters (flags,
    dependency, callback, and callback argument) into an object that is
    passed by reference.

    Also, take this opportunity to fix up the kerneldoc and add notes about
    the relevant ASYNC_TX_* flags for each routine.

    [ Impact: moves api pass-by-value parameters to a pass-by-reference struct ]

    Signed-off-by: Andre Noll
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams
     
  • In support of inter-channel chaining async_tx utilizes an ack flag to
    gate whether a dependent operation can be chained to another. While the
    flag is not set the chain can be considered open for appending. Setting
    the ack flag closes the chain and flags the descriptor for garbage
    collection. The ASYNC_TX_DEP_ACK flag essentially means "close the
    chain after adding this dependency". Since each operation can only have
    one child the api now implicitly sets the ack flag at dependency
    submission time. This removes an unnecessary management burden from
    clients of the api.

    [ Impact: clean up and enforce one dependency per operation ]

    Reviewed-by: Andre Noll
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams