15 Feb, 2017

1 commit

  • commit 0b529f143e8baad441a5aac9ad55ec2434d8fb46 upstream.

    Kernel panics when userspace program try to access AEAD interface.
    Remove node from Linked List before freeing its memory.

    Signed-off-by: Harsh Jain
    Reviewed-by: Stephan Müller
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Harsh Jain
     

08 Dec, 2016

1 commit


07 Dec, 2016

1 commit

  • For encryption, the AEAD ciphers require AAD || PT as input and generate
    AAD || CT || Tag as output and vice versa for decryption. Prior to this
    patch, the AF_ALG interface for AEAD ciphers requires the buffer to be
    present as input for encryption. Similarly, the output buffer for
    decryption required the presence of the tag buffer too. This implies
    that the kernel reads / writes data buffers from/to kernel space
    even though this operation is not required.

    This patch changes the AF_ALG AEAD interface to be consistent with the
    in-kernel AEAD cipher requirements.

    Due to this handling, he changes are transparent to user space with one
    exception: the return code of recv indicates the mount of output buffer.
    That output buffer has a different size compared to before the patch
    which implies that the return code of recv will also be different.
    For example, a decryption operation uses 16 bytes AAD, 16 bytes CT and
    16 bytes tag, the AF_ALG AEAD interface before showed a recv return
    code of 48 (bytes) whereas after this patch, the return code is 32
    since the tag is not returned any more.

    Reported-by: Mat Martineau
    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Stephan Mueller
     

05 Apr, 2016

1 commit

  • Following the async change for algif_skcipher
    this patch adds similar async read to algif_aead.

    changes in v3:
    - add call to aead_reset_ctx directly from aead_put_sgl instead of calling
    them separatelly one after the other
    - remove wait from aead_sock_destruct function as it is not needed
    when sock_hold is used

    changes in v2:
    - change internal data structures from fixed size arrays, limited to
    RSGL_MAX_ENTRIES, to linked list model with no artificial limitation.
    - use sock_kmalloc instead of kmalloc for memory allocation
    - use sock_hold instead of separate atomic ctr to wait for outstanding
    request

    Signed-off-by: Tadeusz Struk
    Signed-off-by: Herbert Xu

    Tadeusz Struk
     

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
     

04 Dec, 2015

1 commit


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
     

17 Nov, 2015

1 commit


25 Aug, 2015

1 commit


17 Aug, 2015

1 commit


22 Jun, 2015

1 commit

  • As the AEAD conversion is still ongoing, we do not yet wish to
    export legacy AEAD implementations to user-space, as their calling
    convention will change.

    This patch actually disables all AEAD algorithms because some of
    them (e.g., cryptd) will need to be modified to propagate this flag.

    Subsequent patches will reenable them on an individual basis.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

28 May, 2015

2 commits


18 May, 2015

1 commit


23 Apr, 2015

1 commit


16 Apr, 2015

1 commit

  • The networking updates from David Miller removed the iocb argument from
    sendmsg and recvmsg (in commit 1b784140474e: "net: Remove iocb argument
    from sendmsg and recvmsg"), but the crypto code had added new instances
    of them.

    When I pulled the crypto update, it was a silent semantic mis-merge, and
    I overlooked the new warning messages in my test-build. I try to fix
    those in the merge itself, but that relies on me noticing. Oh well.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

04 Mar, 2015

1 commit

  • This patch adds the AEAD support for AF_ALG.

    The implementation is based on algif_skcipher, but contains heavy
    modifications to streamline the interface for AEAD uses.

    To use AEAD, the user space consumer has to use the salg_type named
    "aead".

    The AEAD implementation includes some overhead to calculate the size of
    the ciphertext, because the AEAD implementation of the kernel crypto API
    makes implied assumption on the location of the authentication tag. When
    performing an encryption, the tag will be added to the created
    ciphertext (note, the tag is placed adjacent to the ciphertext). For
    decryption, the caller must hand in the ciphertext with the tag appended
    to the ciphertext. Therefore, the selection of the used memory
    needs to add/subtract the tag size from the source/destination buffers
    depending on the encryption type. The code is provided with comments
    explaining when and how that operation is performed.

    A fully working example using all aspects of AEAD is provided at
    http://www.chronox.de/libkcapi.html

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

    Stephan Mueller