13 Jan, 2016

2 commits

  • Pull networking updates from Davic Miller:

    1) Support busy polling generically, for all NAPI drivers. From Eric
    Dumazet.

    2) Add byte/packet counter support to nft_ct, from Floriani Westphal.

    3) Add RSS/XPS support to mvneta driver, from Gregory Clement.

    4) Implement IPV6_HDRINCL socket option for raw sockets, from Hannes
    Frederic Sowa.

    5) Add support for T6 adapter to cxgb4 driver, from Hariprasad Shenai.

    6) Add support for VLAN device bridging to mlxsw switch driver, from
    Ido Schimmel.

    7) Add driver for Netronome NFP4000/NFP6000, from Jakub Kicinski.

    8) Provide hwmon interface to mlxsw switch driver, from Jiri Pirko.

    9) Reorganize wireless drivers into per-vendor directories just like we
    do for ethernet drivers. From Kalle Valo.

    10) Provide a way for administrators "destroy" connected sockets via the
    SOCK_DESTROY socket netlink diag operation. From Lorenzo Colitti.

    11) Add support to add/remove multicast routes via netlink, from Nikolay
    Aleksandrov.

    12) Make TCP keepalive settings per-namespace, from Nikolay Borisov.

    13) Add forwarding and packet duplication facilities to nf_tables, from
    Pablo Neira Ayuso.

    14) Dead route support in MPLS, from Roopa Prabhu.

    15) TSO support for thunderx chips, from Sunil Goutham.

    16) Add driver for IBM's System i/p VNIC protocol, from Thomas Falcon.

    17) Rationalize, consolidate, and more completely document the checksum
    offloading facilities in the networking stack. From Tom Herbert.

    18) Support aborting an ongoing scan in mac80211/cfg80211, from
    Vidyullatha Kanchanapally.

    19) Use per-bucket spinlock for bpf hash facility, from Tom Leiming.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1375 commits)
    net: bnxt: always return values from _bnxt_get_max_rings
    net: bpf: reject invalid shifts
    phonet: properly unshare skbs in phonet_rcv()
    dwc_eth_qos: Fix dma address for multi-fragment skbs
    phy: remove an unneeded condition
    mdio: remove an unneed condition
    mdio_bus: NULL dereference on allocation error
    net: Fix typo in netdev_intersect_features
    net: freescale: mac-fec: Fix build error from phy_device API change
    net: freescale: ucc_geth: Fix build error from phy_device API change
    bonding: Prevent IPv6 link local address on enslaved devices
    IB/mlx5: Add flow steering support
    net/mlx5_core: Export flow steering API
    net/mlx5_core: Make ipv4/ipv6 location more clear
    net/mlx5_core: Enable flow steering support for the IB driver
    net/mlx5_core: Initialize namespaces only when supported by device
    net/mlx5_core: Set priority attributes
    net/mlx5_core: Connect flow tables
    net/mlx5_core: Introduce modify flow table command
    net/mlx5_core: Managing root flow table
    ...

    Linus Torvalds
     
  • Pull crypto update from Herbert Xu:
    "Algorithms:
    - Add RSA padding algorithm

    Drivers:
    - Add GCM mode support to atmel
    - Add atmel support for SAMA5D2 devices
    - Add cipher modes to talitos
    - Add rockchip driver for rk3288
    - Add qat support for C3XXX and C62X"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (103 commits)
    crypto: hifn_795x, picoxcell - use ablkcipher_request_cast
    crypto: qat - fix SKU definiftion for c3xxx dev
    crypto: qat - Fix random config build issue
    crypto: ccp - use to_pci_dev and to_platform_device
    crypto: qat - Rename dh895xcc mmp firmware
    crypto: 842 - remove WARN inside printk
    crypto: atmel-aes - add debug facilities to monitor register accesses.
    crypto: atmel-aes - add support to GCM mode
    crypto: atmel-aes - change the DMA threshold
    crypto: atmel-aes - fix the counter overflow in CTR mode
    crypto: atmel-aes - fix atmel-ctr-aes driver for RFC 3686
    crypto: atmel-aes - create sections to regroup functions by usage
    crypto: atmel-aes - fix typo and indentation
    crypto: atmel-aes - use SIZE_IN_WORDS() helper macro
    crypto: atmel-aes - improve performances of data transfer
    crypto: atmel-aes - fix atmel_aes_remove()
    crypto: atmel-aes - remove useless AES_FLAGS_DMA flag
    crypto: atmel-aes - reduce latency of DMA completion
    crypto: atmel-aes - remove unused 'err' member of struct atmel_aes_dev
    crypto: atmel-aes - rework crypto request completion
    ...

    Linus Torvalds
     

07 Jan, 2016

1 commit

  • These async_XX functions are called from md/raid5 in an atomic
    section, between get_cpu() and put_cpu(), so they must not sleep.
    So use GFP_NOWAIT rather than GFP_IO.

    Dan Williams writes: Longer term async_tx needs to be merged into md
    directly as we can allocate this unmap data statically per-stripe
    rather than per request.

    Fixed: 7476bd79fc01 ("async_pq: convert to dmaengine_unmap_data")
    Cc: stable@vger.kernel.org (v3.13+)
    Reported-and-tested-by: Stanislav Samsonov
    Acked-by: Dan Williams
    Signed-off-by: NeilBrown
    Signed-off-by: Vinod Koul

    NeilBrown
     

01 Jan, 2016

1 commit


29 Dec, 2015

1 commit


22 Dec, 2015

3 commits


18 Dec, 2015

1 commit


16 Dec, 2015

1 commit


11 Dec, 2015

1 commit

  • This file does not contain any modular related function calls. So get
    rid of module.h since it drags in a lot of other headers and adds to
    the preprocessing load. It does export some symbols though, so we'll
    need to ensure it has export.h present instead.

    Cc: Herbert Xu
    Cc: "David S. Miller"
    Cc: linux-crypto@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Herbert Xu

    Paul Gortmaker
     

10 Dec, 2015

1 commit


09 Dec, 2015

4 commits

  • Some ciphers actually support encrypting zero length plaintexts. For
    example, many AEAD modes support this. The resulting ciphertext for
    those winds up being only the authentication tag, which is a result of
    the key, the iv, the additional data, and the fact that the plaintext
    had zero length. The blkcipher constructors won't copy the IV to the
    right place, however, when using a zero length input, resulting in
    some significant problems when ciphers call their initialization
    routines, only to find that the ->iv parameter is uninitialized. One
    such example of this would be using chacha20poly1305 with a zero length
    input, which then calls chacha20, which calls the key setup routine,
    which eventually OOPSes due to the uninitialized ->iv member.

    Signed-off-by: Jason A. Donenfeld
    Cc:
    Signed-off-by: Herbert Xu

    Jason A. Donenfeld
     
  • If the length of the plaintext is zero, there's no need to waste cycles
    on encryption and decryption. Using the chacha20poly1305 construction
    for zero-length plaintexts is a common way of using a shared encryption
    key for AAD authentication.

    Signed-off-by: Jason A. Donenfeld
    Signed-off-by: Herbert Xu

    Jason A. Donenfeld
     
  • This patch adds PKCS#1 v1.5 standard RSA padding as a separate template.
    This way an RSA cipher with padding can be obtained by instantiating
    "pkcs1pad(rsa)". The reason for adding this is that RSA is almost
    never used without this padding (or OAEP) so it will be needed for
    either certificate work in the kernel or the userspace, and I also hear
    that it is likely implemented by hardware RSA in which case hardware
    implementations of the whole of pkcs1pad(rsa) can be provided.

    Signed-off-by: Andrew Zaborowski
    Signed-off-by: Herbert Xu

    Andrzej Zaborowski
     
  • Add a struct akcipher_instance and struct akcipher_spawn similar to
    how AEAD declares them and the macros for converting to/from
    crypto_instance/crypto_spawn. Also add register functions to
    avoid exposing crypto_akcipher_type.

    Signed-off-by: Andrew Zaborowski
    Signed-off-by: Herbert Xu

    Andrzej Zaborowski
     

04 Dec, 2015

2 commits


02 Dec, 2015

1 commit

  • This patch is a cleanup to make following patch easier to
    review.

    Goal is to move SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA
    from (struct socket)->flags to a (struct socket_wq)->flags
    to benefit from RCU protection in sock_wake_async()

    To ease backports, we rename both constants.

    Two new helpers, sk_set_bit(int nr, struct sock *sk)
    and sk_clear_bit(int net, struct sock *sk) are added so that
    following patch can change their implementation.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

01 Dec, 2015

1 commit

  • The memory barrier in the helper wq_has_sleeper is needed by just
    about every user of waitqueue_active. This patch generalises it
    by making it take a wait_queue_head_t directly. The existing
    helper is renamed to skwq_has_sleeper.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

27 Nov, 2015

1 commit


23 Nov, 2015

3 commits


17 Nov, 2015

2 commits

  • rhe RSA operations explicitly left-align the integers being written
    skipping any leading zero bytes, but still require the output buffers to
    include just enough space for the integer + the leading zero bytes.
    Since the size of integer + the leading zero bytes (i.e. the key modulus
    size) can now be obtained more easily through crypto_akcipher_maxsize
    change the operations to only require as big a buffer as actually needed
    if the caller has that information. The semantics for request->dst_len
    don't change.

    Signed-off-by: Andrew Zaborowski
    Signed-off-by: Herbert Xu

    Andrzej Zaborowski
     
  • Some variable are set as int but store only positive values.
    Furthermore there are used in operation/function that wait for unsigned
    value.
    This patch set them as size_t.

    Signed-off-by: LABBE Corentin
    Signed-off-by: Herbert Xu

    LABBE Corentin
     

12 Nov, 2015

2 commits

  • This fixes CVE-2015-5327. It affects kernels from 4.3-rc1 onwards.

    Fix the X.509 time validation to use month number-1 when looking up the
    number of days in that month. Also put the month number validation before
    doing the lookup so as not to risk overrunning the array.

    This can be tested by doing the following:

    cat <
    Signed-off-by: David Howells
    Tested-by: Mimi Zohar
    Acked-by: David Woodhouse
    Signed-off-by: James Morris

    David Howells
     
  • Pull crypto fix from Herbert Xu:
    "This fixes a bug in the algif_hash interface that may lead to crashes
    when used with certain algorithms such as HMAC"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: algif_hash - Only export and import on sockets with data

    Linus Torvalds
     

06 Nov, 2015

1 commit

  • Pull security subsystem update from James Morris:
    "This is mostly maintenance updates across the subsystem, with a
    notable update for TPM 2.0, and addition of Jarkko Sakkinen as a
    maintainer of that"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (40 commits)
    apparmor: clarify CRYPTO dependency
    selinux: Use a kmem_cache for allocation struct file_security_struct
    selinux: ioctl_has_perm should be static
    selinux: use sprintf return value
    selinux: use kstrdup() in security_get_bools()
    selinux: use kmemdup in security_sid_to_context_core()
    selinux: remove pointless cast in selinux_inode_setsecurity()
    selinux: introduce security_context_str_to_sid
    selinux: do not check open perm on ftruncate call
    selinux: change CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE default
    KEYS: Merge the type-specific data with the payload data
    KEYS: Provide a script to extract a module signature
    KEYS: Provide a script to extract the sys cert list from a vmlinux file
    keys: Be more consistent in selection of union members used
    certs: add .gitignore to stop git nagging about x509_certificate_list
    KEYS: use kvfree() in add_key
    Smack: limited capability for changing process label
    TPM: remove unnecessary little endian conversion
    vTPM: support little endian guests
    char: Drop owner assignment from i2c_driver
    ...

    Linus Torvalds
     

05 Nov, 2015

1 commit

  • Pull crypto update from Herbert Xu:
    "API:

    - Add support for cipher output IVs in testmgr
    - Add missing crypto_ahash_blocksize helper
    - Mark authenc and des ciphers as not allowed under FIPS.

    Algorithms:

    - Add CRC support to 842 compression
    - Add keywrap algorithm
    - A number of changes to the akcipher interface:
    + Separate functions for setting public/private keys.
    + Use SG lists.

    Drivers:

    - Add Intel SHA Extension optimised SHA1 and SHA256
    - Use dma_map_sg instead of custom functions in crypto drivers
    - Add support for STM32 RNG
    - Add support for ST RNG
    - Add Device Tree support to exynos RNG driver
    - Add support for mxs-dcp crypto device on MX6SL
    - Add xts(aes) support to caam
    - Add ctr(aes) and xts(aes) support to qat
    - A large set of fixes from Russell King for the marvell/cesa driver"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (115 commits)
    crypto: asymmetric_keys - Fix unaligned access in x509_get_sig_params()
    crypto: akcipher - Don't #include crypto/public_key.h as the contents aren't used
    hwrng: exynos - Add Device Tree support
    hwrng: exynos - Fix missing configuration after suspend to RAM
    hwrng: exynos - Add timeout for waiting on init done
    dt-bindings: rng: Describe Exynos4 PRNG bindings
    crypto: marvell/cesa - use __le32 for hardware descriptors
    crypto: marvell/cesa - fix missing cpu_to_le32() in mv_cesa_dma_add_op()
    crypto: marvell/cesa - use memcpy_fromio()/memcpy_toio()
    crypto: marvell/cesa - use gfp_t for gfp flags
    crypto: marvell/cesa - use dma_addr_t for cur_dma
    crypto: marvell/cesa - use readl_relaxed()/writel_relaxed()
    crypto: caam - fix indentation of close braces
    crypto: caam - only export the state we really need to export
    crypto: caam - fix non-block aligned hash calculation
    crypto: caam - avoid needlessly saving and restoring caam_hash_ctx
    crypto: caam - print errno code when hash registration fails
    crypto: marvell/cesa - fix memory leak
    crypto: marvell/cesa - fix first-fragment handling in mv_cesa_ahash_dma_last_req()
    crypto: marvell/cesa - rearrange handling for sw padded hashes
    ...

    Linus Torvalds
     

02 Nov, 2015

1 commit

  • The hash_accept call fails to work on sockets that have not received
    any data. For some algorithm implementations it may cause crashes.

    This patch fixes this by ensuring that we only export and import on
    sockets that have received data.

    Cc: stable@vger.kernel.org
    Reported-by: Harsh Jain
    Signed-off-by: Herbert Xu
    Tested-by: Stephan Mueller

    Herbert Xu
     

28 Oct, 2015

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
     

20 Oct, 2015

3 commits

  • x509_get_sig_params() has the same code pattern as the one in
    pkcs7_verify() that is fixed by commit 62f57d05e287 ("crypto: pkcs7 - Fix
    unaligned access in pkcs7_verify()") so apply a similar fix here: make
    sure that desc is pointing at an algined value past the digest_size,
    and take alignment values into consideration when doing kzalloc()

    Signed-off-by: Sowmini Varadhan
    Acked-by: David Howells
    Signed-off-by: Herbert Xu

    Sowmini Varadhan
     
  • Don't #include crypto/public_key.h in akcipher as the contents of the
    header aren't used and changes in a future patch cause it to fail to
    compile if CONFIG_KEYS=n.

    Signed-off-by: David Howells
    Signed-off-by: Herbert Xu

    David Howells
     
  • Currently a number of Crypto API operations may fail when a signal
    occurs. This causes nasty problems as the caller of those operations
    are often not in a good position to restart the operation.

    In fact there is currently no need for those operations to be
    interrupted by user signals at all. All we need is for them to
    be killable.

    This patch replaces the relevant calls of signal_pending with
    fatal_signal_pending, and wait_for_completion_interruptible with
    wait_for_completion_killable, respectively.

    Cc: stable@vger.kernel.org
    Signed-off-by: Herbert Xu

    Herbert Xu
     

15 Oct, 2015

4 commits

  • The testmanager code for symmetric ciphers is extended to allow
    verification of the IV after a cipher operation.

    In addition, test vectors for kw(aes) for encryption and decryption are
    added.

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

    Stephan Mueller
     
  • Hook keywrap source code into Kconfig and Makefile

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

    Stephan Mueller
     
  • This patch implements the AES key wrapping as specified in
    NIST SP800-38F and RFC3394.

    The implementation covers key wrapping without padding.

    IV handling: The caller does not provide an IV for encryption,
    but must obtain the IV after encryption which would serve as the first
    semblock in the ciphertext structure defined by SP800-38F. Conversely,
    for decryption, the caller must provide the first semiblock of the data
    as the IV and the following blocks as ciphertext.

    The key wrapping is an authenticated decryption operation. The caller
    will receive EBADMSG during decryption if the authentication failed.

    Albeit the standards define the key wrapping for AES only, the template
    can be used with any other block cipher that has a block size of 16
    bytes. During initialization of the template, that condition is checked.
    Any cipher not having a block size of 16 bytes will cause the
    initialization to fail.

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

    Stephan Mueller
     
  • The crypto drivers are supposed to update the IV passed to the crypto
    request before calling the completion callback.
    Test for the IV value before considering the test as successful.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Herbert Xu

    Boris BREZILLON