15 Jul, 2017

1 commit

  • Pull crypto fixes from Herbert Xu:

    - fix new compiler warnings in cavium

    - set post-op IV properly in caam (this fixes chaining)

    - fix potential use-after-free in atmel in case of EBUSY

    - fix sleeping in softirq path in chcr

    - disable buggy sha1-avx2 driver (may overread and page fault)

    - fix use-after-free on signals in caam

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: cavium - make several functions static
    crypto: chcr - Avoid algo allocation in softirq.
    crypto: caam - properly set IV after {en,de}crypt
    crypto: atmel - only treat EBUSY as transient if backlog
    crypto: af_alg - Avoid sock_graft call warning
    crypto: caam - fix signals handling
    crypto: sha1-ssse3 - Disable avx2

    Linus Torvalds
     

12 Jul, 2017

1 commit

  • crypto: af_alg - Avoid sock_graft call warning

    The newly added sock_graft warning triggers in af_alg_accept.
    It's harmless as we're essentially doing sock->sk = sock->sk.

    The sock_graft call is actually redundant because all the work
    it does is subsumed by sock_init_data. However, it was added
    to placate SELinux as it uses it to initialise its internal state.

    This patch avoisd the warning by making the SELinux call directly.

    Reported-by: Linus Torvalds
    Signed-off-by: Herbert Xu
    Acked-by: David S. Miller

    Herbert Xu
     

09 Jul, 2017

1 commit

  • Pull dmaengine updates from Vinod Koul:

    - removal of AVR32 support in dw driver as AVR32 is gone

    - new driver for Broadcom stream buffer accelerator (SBA) RAID driver

    - add support for Faraday Technology FTDMAC020 in amba-pl08x driver

    - IOMMU support in pl330 driver

    - updates to bunch of drivers

    * tag 'dmaengine-4.13-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (36 commits)
    dmaengine: qcom_hidma: correct API violation for submit
    dmaengine: zynqmp_dma: Remove max len check in zynqmp_dma_prep_memcpy
    dmaengine: tegra-apb: Really fix runtime-pm usage
    dmaengine: fsl_raid: make of_device_ids const.
    dmaengine: qcom_hidma: allow ACPI/DT parameters to be overridden
    dmaengine: fsldma: set BWC, DAHTS and SAHTS values correctly
    dmaengine: Kconfig: Simplify the help text for MXS_DMA
    dmaengine: pl330: Delete unused functions
    dmaengine: Replace WARN_TAINT_ONCE() with pr_warn_once()
    dmaengine: Kconfig: Extend the dependency for MXS_DMA
    dmaengine: mxs: Use %zu for printing a size_t variable
    dmaengine: ste_dma40: Cleanup scatterlist layering violations
    dmaengine: imx-dma: cleanup scatterlist layering violations
    dmaengine: use proper name for the R-Car SoC
    dmaengine: imx-sdma: Fix compilation warning.
    dmaengine: imx-sdma: Handle return value of clk_prepare_enable
    dmaengine: pl330: Add IOMMU support to slave tranfers
    dmaengine: DW DMAC: Handle return value of clk_prepare_enable
    dmaengine: pl08x: use GENMASK() to create bitmasks
    dmaengine: pl08x: Add support for Faraday Technology FTDMAC020
    ...

    Linus Torvalds
     

06 Jul, 2017

2 commits

  • Pull networking updates from David Miller:
    "Reasonably busy this cycle, but perhaps not as busy as in the 4.12
    merge window:

    1) Several optimizations for UDP processing under high load from
    Paolo Abeni.

    2) Support pacing internally in TCP when using the sch_fq packet
    scheduler for this is not practical. From Eric Dumazet.

    3) Support mutliple filter chains per qdisc, from Jiri Pirko.

    4) Move to 1ms TCP timestamp clock, from Eric Dumazet.

    5) Add batch dequeueing to vhost_net, from Jason Wang.

    6) Flesh out more completely SCTP checksum offload support, from
    Davide Caratti.

    7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
    Neira Ayuso, and Matthias Schiffer.

    8) Add devlink support to nfp driver, from Simon Horman.

    9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
    Prabhu.

    10) Add stack depth tracking to BPF verifier and use this information
    in the various eBPF JITs. From Alexei Starovoitov.

    11) Support XDP on qed device VFs, from Yuval Mintz.

    12) Introduce BPF PROG ID for better introspection of installed BPF
    programs. From Martin KaFai Lau.

    13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.

    14) For loads, allow narrower accesses in bpf verifier checking, from
    Yonghong Song.

    15) Support MIPS in the BPF selftests and samples infrastructure, the
    MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
    Daney.

    16) Support kernel based TLS, from Dave Watson and others.

    17) Remove completely DST garbage collection, from Wei Wang.

    18) Allow installing TCP MD5 rules using prefixes, from Ivan
    Delalande.

    19) Add XDP support to Intel i40e driver, from Björn Töpel

    20) Add support for TC flower offload in nfp driver, from Simon
    Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
    Kicinski, and Bert van Leeuwen.

    21) IPSEC offloading support in mlx5, from Ilan Tayari.

    22) Add HW PTP support to macb driver, from Rafal Ozieblo.

    23) Networking refcount_t conversions, From Elena Reshetova.

    24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
    for tuning the TCP sockopt settings of a group of applications,
    currently via CGROUPs"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
    net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
    dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
    cxgb4: Support for get_ts_info ethtool method
    cxgb4: Add PTP Hardware Clock (PHC) support
    cxgb4: time stamping interface for PTP
    nfp: default to chained metadata prepend format
    nfp: remove legacy MAC address lookup
    nfp: improve order of interfaces in breakout mode
    net: macb: remove extraneous return when MACB_EXT_DESC is defined
    bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
    bpf: fix return in load_bpf_file
    mpls: fix rtm policy in mpls_getroute
    net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
    net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
    ...

    Linus Torvalds
     
  • 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
     

05 Jul, 2017

1 commit


01 Jul, 2017

1 commit

  • refcount_t type and corresponding API should be
    used instead of atomic_t when the variable is used as
    a reference counter. This allows to avoid accidental
    refcounter overflows that might lead to use-after-free
    situations.

    This patch uses refcount_inc_not_zero() instead of
    atomic_inc_not_zero_hint() due to absense of a _hint()
    version of refcount API. If the hint() version must
    be used, we might need to revisit API.

    Signed-off-by: Elena Reshetova
    Signed-off-by: Hans Liljestrand
    Signed-off-by: Kees Cook
    Signed-off-by: David Windsor
    Signed-off-by: David S. Miller

    Reshetova, Elena
     

28 Jun, 2017

1 commit


22 Jun, 2017

1 commit


20 Jun, 2017

2 commits


19 Jun, 2017

4 commits


10 Jun, 2017

14 commits


09 Jun, 2017

2 commits


23 May, 2017

4 commits

  • Many HMAC users directly use directly 0x36/0x5c values.
    It's better with crypto to use a name instead of directly some crypto
    constant.

    This patch simply add HMAC_IPAD_VALUE/HMAC_OPAD_VALUE defines in a new
    include file "crypto/hmac.h" and use them in crypto/hmac.c

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

    Corentin LABBE
     
  • crypto_gcm_setkey() was using wait_for_completion_interruptible() to
    wait for completion of async crypto op but if a signal occurs it
    may return before DMA ops of HW crypto provider finish, thus
    corrupting the data buffer that is kfree'ed in this case.

    Resolve this by using wait_for_completion() instead.

    Reported-by: Eric Biggers
    Signed-off-by: Gilad Ben-Yossef
    CC: stable@vger.kernel.org
    Signed-off-by: Herbert Xu

    Gilad Ben-Yossef
     
  • drbg_kcapi_sym_ctr() was using wait_for_completion_interruptible() to
    wait for completion of async crypto op but if a signal occurs it
    may return before DMA ops of HW crypto provider finish, thus
    corrupting the output buffer.

    Resolve this by using wait_for_completion() instead.

    Reported-by: Eric Biggers
    Signed-off-by: Gilad Ben-Yossef
    CC: stable@vger.kernel.org
    Signed-off-by: Herbert Xu

    Gilad Ben-Yossef
     
  • public_key_verify_signature() was passing the CRYPTO_TFM_REQ_MAY_BACKLOG
    flag to akcipher_request_set_callback() but was not handling correctly
    the case where a -EBUSY error could be returned from the call to
    crypto_akcipher_verify() if backlog was used, possibly casuing
    data corruption due to use-after-free of buffers.

    Resolve this by handling -EBUSY correctly.

    Signed-off-by: Gilad Ben-Yossef
    CC: stable@vger.kernel.org
    Signed-off-by: Herbert Xu

    Gilad Ben-Yossef
     

18 May, 2017

2 commits

  • The tcrypt AEAD cycles speed tests disables irqs during the test, which is
    broken at the very least since commit
    '1425d2d17f7309c6 ("crypto: tcrypt - Fix AEAD speed tests")'
    adds a wait for completion as part of the test and probably since
    switching to the new AEAD API.

    While the result of taking a cycle count diff may not mean much on SMP
    systems if the task migrates, it's good enough for tcrypt being the quick
    & dirty dev tool it is. It's also what all the other (i.e. hash) cycle
    speed tests do.

    Signed-off-by: Gilad Ben-Yossef
    Reported-by: Ofir Drang
    Reviewed-by: Horia Geantă
    Signed-off-by: Herbert Xu

    Gilad Ben-Yossef
     
  • The API setkey checks for key sizes and alignment went AWOL during the
    skcipher conversion. This patch restores them.

    Cc:
    Fixes: 4e6c3df4d729 ("crypto: skcipher - Add low-level skcipher...")
    Reported-by: Baozeng
    Signed-off-by: Herbert Xu

    Herbert Xu
     

16 May, 2017

1 commit

  • The DMA_PREP_FENCE is to be used when preparing Tx descriptor if output
    of Tx descriptor is to be used by next/dependent Tx descriptor.

    The DMA_PREP_FENSE will not be set correctly in do_async_gen_syndrome()
    when calling dma->device_prep_dma_pq() under following conditions:
    1. ASYNC_TX_FENCE not set in submit->flags
    2. DMA_PREP_FENCE not set in dma_flags
    3. src_cnt (= (disks - 2)) is greater than dma_maxpq(dma, dma_flags)

    This patch fixes DMA_PREP_FENCE usage in do_async_gen_syndrome() taking
    inspiration from do_async_xor() implementation.

    Signed-off-by: Anup Patel
    Reviewed-by: Ray Jui
    Reviewed-by: Scott Branden
    Acked-by: Dan Williams
    Signed-off-by: Vinod Koul

    Anup Patel
     

09 May, 2017

1 commit

  • There are many code paths opencoding kvmalloc. Let's use the helper
    instead. The main difference to kvmalloc is that those users are
    usually not considering all the aspects of the memory allocator. E.g.
    allocation requests
    Reviewed-by: Boris Ostrovsky # Xen bits
    Acked-by: Kees Cook
    Acked-by: Vlastimil Babka
    Acked-by: Andreas Dilger # Lustre
    Acked-by: Christian Borntraeger # KVM/s390
    Acked-by: Dan Williams # nvdim
    Acked-by: David Sterba # btrfs
    Acked-by: Ilya Dryomov # Ceph
    Acked-by: Tariq Toukan # mlx4
    Acked-by: Leon Romanovsky # mlx5
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Herbert Xu
    Cc: Anton Vorontsov
    Cc: Colin Cross
    Cc: Tony Luck
    Cc: "Rafael J. Wysocki"
    Cc: Ben Skeggs
    Cc: Kent Overstreet
    Cc: Santosh Raspatur
    Cc: Hariprasad S
    Cc: Yishai Hadas
    Cc: Oleg Drokin
    Cc: "Yan, Zheng"
    Cc: Alexander Viro
    Cc: Alexei Starovoitov
    Cc: Eric Dumazet
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     

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