1. 20 May, 2018 17 commits
    • Eric Biggers's avatar
      fscrypt: add Speck128/256 support · 12d28f79
      Eric Biggers authored
      fscrypt currently only supports AES encryption.  However, many low-end
      mobile devices have older CPUs that don't have AES instructions, e.g.
      the ARMv8 Cryptography Extensions.  Currently, user data on such devices
      is not encrypted at rest because AES is too slow, even when the NEON
      bit-sliced implementation of AES is used.  Unfortunately, it is
      infeasible to encrypt these devices at all when AES is the only option.
      
      Therefore, this patch updates fscrypt to support the Speck block cipher,
      which was recently added to the crypto API.  The C implementation of
      Speck is not especially fast, but Speck can be implemented very
      efficiently with general-purpose vector instructions, e.g. ARM NEON.
      For example, on an ARMv7 processor, we measured the NEON-accelerated
      Speck128/256-XTS at 69 MB/s for both encryption and decryption, while
      AES-256-XTS with the NEON bit-sliced implementation was only 22 MB/s
      encryption and 19 MB/s decryption.
      
      There are multiple variants of Speck.  This patch only adds support for
      Speck128/256, which is the variant with a 128-bit block size and 256-bit
      key size -- the same as AES-256.  This is believed to be the most secure
      variant of Speck, and it's only about 6% slower than Speck128/128.
      Speck64/128 would be at least 20% faster because it has 20% rounds, and
      it can be even faster on CPUs that can't efficiently do the 64-bit
      operations needed for Speck128.  However, Speck64's 64-bit block size is
      not preferred security-wise.  ARM NEON also supports the needed 64-bit
      operations even on 32-bit CPUs, resulting in Speck128 being fast enough
      for our targeted use cases so far.
      
      The chosen modes of operation are XTS for contents and CTS-CBC for
      filenames.  These are the same modes of operation that fscrypt defaults
      to for AES.  Note that as with the other fscrypt modes, Speck will not
      be used unless userspace chooses to use it.  Nor are any of the existing
      modes (which are all AES-based) being removed, of course.
      
      We intentionally don't make CONFIG_FS_ENCRYPTION select
      CONFIG_CRYPTO_SPECK, so people will have to enable Speck support
      themselves if they need it.  This is because we shouldn't bloat the
      FS_ENCRYPTION dependencies with every new cipher, especially ones that
      aren't recommended for most users.  Moreover, CRYPTO_SPECK is just the
      generic implementation, which won't be fast enough for many users; in
      practice, they'll need to enable CRYPTO_SPECK_NEON to get acceptable
      performance.
      
      More details about our choice of Speck can be found in our patches that
      added Speck to the crypto API, and the follow-on discussion threads.
      We're planning a publication that explains the choice in more detail.
      But briefly, we can't use ChaCha20 as we previously proposed, since it
      would be insecure to use a stream cipher in this context, with potential
      IV reuse during writes on f2fs and/or on wear-leveling flash storage.
      
      We also evaluated many other lightweight and/or ARX-based block ciphers
      such as Chaskey-LTS, RC5, LEA, CHAM, Threefish, RC6, NOEKEON, SPARX, and
      XTEA.  However, all had disadvantages vs. Speck, such as insufficient
      performance with NEON, much less published cryptanalysis, or an
      insufficient security level.  Various design choices in Speck make it
      perform better with NEON than competing ciphers while still having a
      security margin similar to AES, and in the case of Speck128 also the
      same available security levels.  Unfortunately, Speck does have some
      political baggage attached -- it's an NSA designed cipher, and was
      rejected from an ISO standard (though for context, as far as I know none
      of the above-mentioned alternatives are ISO standards either).
      Nevertheless, we believe it is a good solution to the problem from a
      technical perspective.
      
      Certain algorithms constructed from ChaCha or the ChaCha permutation,
      such as MEM (Masked Even-Mansour) or HPolyC, may also meet our
      performance requirements.  However, these are new constructions that
      need more time to receive the cryptographic review and acceptance needed
      to be confident in their security.  HPolyC hasn't been published yet,
      and we are concerned that MEM makes stronger assumptions about the
      underlying permutation than the ChaCha stream cipher does.  In contrast,
      the XTS mode of operation is relatively well accepted, and Speck has
      over 70 cryptanalysis papers.  Of course, these ChaCha-based algorithms
      can still be added later if they become ready.
      
      The best known attack on Speck128/256 is a differential cryptanalysis
      attack on 25 of 34 rounds with 2^253 time complexity and 2^125 chosen
      plaintexts, i.e. only marginally faster than brute force.  There is no
      known attack on the full 34 rounds.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      12d28f79
    • Eric Biggers's avatar
      fscrypt: only derive the needed portion of the key · 646b7d4f
      Eric Biggers authored
      Currently the key derivation function in fscrypt uses the master key
      length as the amount of output key material to derive.  This works, but
      it means we can waste time deriving more key material than is actually
      used, e.g. most commonly, deriving 64 bytes for directories which only
      take a 32-byte AES-256-CTS-CBC key.  It also forces us to validate that
      the master key length is a multiple of AES_BLOCK_SIZE, which wouldn't
      otherwise be necessary.
      
      Fix it to only derive the needed length key.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      646b7d4f
    • Eric Biggers's avatar
      fscrypt: separate key lookup from key derivation · 590f497d
      Eric Biggers authored
      Refactor the confusingly-named function 'validate_user_key()' into a new
      function 'find_and_derive_key()' which first finds the keyring key, then
      does the key derivation.  Among other benefits this avoids the strange
      behavior we had previously where if key derivation failed for some
      reason, then we would fall back to the alternate key prefix.  Now, we'll
      only fall back to the alternate key prefix if a valid key isn't found.
      
      This patch also improves the warning messages that are logged when the
      keyring key's payload is invalid.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      590f497d
    • Eric Biggers's avatar
      fscrypt: use a common logging function · 544d08fd
      Eric Biggers authored
      Use a common function for fscrypt warning and error messages so that all
      the messages are consistently ratelimited, include the "fscrypt:"
      prefix, and include the filesystem name if applicable.
      
      Also fix up a few of the log messages to be more descriptive.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      544d08fd
    • Eric Biggers's avatar
      fscrypt: remove internal key size constants · 11b8818e
      Eric Biggers authored
      With one exception, the internal key size constants such as
      FS_AES_256_XTS_KEY_SIZE are only used for the 'available_modes' array,
      where they really only serve to obfuscate what the values are.  Also
      some of the constants are unused, and the key sizes tend to be in the
      names of the algorithms anyway.  In the past these values were also
      misused, e.g. we used to have FS_AES_256_XTS_KEY_SIZE in places that
      technically should have been FS_MAX_KEY_SIZE.
      
      The exception is that FS_AES_128_ECB_KEY_SIZE is used for key
      derivation.  But it's more appropriate to use
      FS_KEY_DERIVATION_NONCE_SIZE for that instead.
      
      Thus, just put the sizes directly in the 'available_modes' array.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      11b8818e
    • Eric Biggers's avatar
      fscrypt: remove unnecessary check for non-logon key type · 1086c80c
      Eric Biggers authored
      We're passing 'key_type_logon' to request_key(), so the found key is
      guaranteed to be of type "logon".  Thus, there is no reason to check
      later that the key is really a "logon" key.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      1086c80c
    • Eric Biggers's avatar
      fscrypt: make fscrypt_operations.max_namelen an integer · e12ee683
      Eric Biggers authored
      Now ->max_namelen() is only called to limit the filename length when
      adding NUL padding, and only for real filenames -- not symlink targets.
      It also didn't give the correct length for symlink targets anyway since
      it forgot to subtract 'sizeof(struct fscrypt_symlink_data)'.
      
      Thus, change ->max_namelen from a function to a simple 'unsigned int'
      that gives the filesystem's maximum filename length.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      e12ee683
    • Eric Biggers's avatar
      fscrypt: drop empty name check from fname_decrypt() · 0c4cdb27
      Eric Biggers authored
      fname_decrypt() is validating that the encrypted filename is nonempty.
      However, earlier a stronger precondition was already enforced: the
      encrypted filename must be at least 16 (FS_CRYPTO_BLOCK_SIZE) bytes.
      
      Drop the redundant check for an empty filename.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      0c4cdb27
    • Eric Biggers's avatar
      fscrypt: drop max_namelen check from fname_decrypt() · 54632f02
      Eric Biggers authored
      fname_decrypt() returns an error if the input filename is longer than
      the inode's ->max_namelen() as given by the filesystem.  But, this
      doesn't actually make sense because the filesystem provided the input
      filename in the first place, where it was subject to the filesystem's
      limits.  And fname_decrypt() has no internal limit itself.
      
      Thus, remove this unnecessary check.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      54632f02
    • Eric Biggers's avatar
      fscrypt: don't special-case EOPNOTSUPP from fscrypt_get_encryption_info() · 17bfde60
      Eric Biggers authored
      In fscrypt_setup_filename(), remove the unnecessary check for
      fscrypt_get_encryption_info() returning EOPNOTSUPP.  There's no reason
      to handle this error differently from any other.  I think there may have
      been some confusion because the "notsupp" version of
      fscrypt_get_encryption_info() returns EOPNOTSUPP -- but that's not
      applicable from inside fs/crypto/.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      17bfde60
    • Eric Biggers's avatar
      fscrypt: don't clear flags on crypto transform · 101c97a3
      Eric Biggers authored
      fscrypt is clearing the flags on the crypto_skcipher it allocates for
      each inode.  But, this is unnecessary and may cause problems in the
      future because it will even clear flags that are meant to be internal to
      the crypto API, e.g. CRYPTO_TFM_NEED_KEY.
      
      Remove the unnecessary flag clearing.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      101c97a3
    • Eric Biggers's avatar
      1da2f0ac
    • Eric Biggers's avatar
      fscrypt: remove error messages for skcipher_request_alloc() failure · c90fd775
      Eric Biggers authored
      skcipher_request_alloc() can only fail due to lack of memory, and in
      that case the memory allocator will have already printed a detailed
      error message.  Thus, remove the redundant error messages from fscrypt.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      c90fd775
    • Eric Biggers's avatar
      fscrypt: remove unnecessary NULL check when allocating skcipher · 9919479b
      Eric Biggers authored
      crypto_alloc_skcipher() returns an ERR_PTR() on failure, not NULL.
      Remove the unnecessary check for NULL.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      9919479b
    • Eric Biggers's avatar
      fscrypt: clean up after fscrypt_prepare_lookup() conversions · 54222025
      Eric Biggers authored
      Now that all filesystems have been converted to use
      fscrypt_prepare_lookup(), we can remove the fscrypt_set_d_op() and
      fscrypt_set_encrypted_dentry() functions as well as un-export
      fscrypt_d_ops.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      54222025
    • Eric Biggers's avatar
      fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled · bbbc3fb6
      Eric Biggers authored
      Now that filesystems only set and use their fscrypt_operations when they
      are built with encryption support, we can remove ->s_cop from
      'struct super_block' when FS_ENCRYPTION is disabled.  This saves a few
      bytes on some kernels and also makes it consistent with ->i_crypt_info.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      bbbc3fb6
    • Eric Biggers's avatar
      fscrypt: use unbound workqueue for decryption · 36dd26e0
      Eric Biggers authored
      Improve fscrypt read performance by switching the decryption workqueue
      from bound to unbound.  With the bound workqueue, when multiple bios
      completed on the same CPU, they were decrypted on that same CPU.  But
      with the unbound queue, they are now decrypted in parallel on any CPU.
      
      Although fscrypt read performance can be tough to measure due to the
      many sources of variation, this change is most beneficial when
      decryption is slow, e.g. on CPUs without AES instructions.  For example,
      I timed tarring up encrypted directories on f2fs.  On x86 with AES-NI
      instructions disabled, the unbound workqueue improved performance by
      about 25-35%, using 1 to NUM_CPUs jobs with 4 or 8 CPUs available.  But
      with AES-NI enabled, performance was unchanged to within ~2%.
      
      I also did the same test on a quad-core ARM CPU using xts-speck128-neon
      encryption.  There performance was usually about 10% better with the
      unbound workqueue, bringing it closer to the unencrypted speed.
      
      The unbound workqueue may be worse in some cases due to worse locality,
      but I think it's still the better default.  dm-crypt uses an unbound
      workqueue by default too, so this change makes fscrypt match.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      36dd26e0
  2. 07 May, 2018 1 commit
  3. 06 May, 2018 7 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 701e39d0
      Linus Torvalds authored
      Pll KVM fixes from Radim Krčmář:
       "ARM:
         - Fix proxying of GICv2 CPU interface accesses
         - Fix crash when switching to BE
         - Track source vcpu git GICv2 SGIs
         - Fix an outdated bit of documentation
      
        x86:
         - Speed up injection of expired timers (for stable)"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: x86: remove APIC Timer periodic/oneshot spikes
        arm64: vgic-v2: Fix proxying of cpuif access
        KVM: arm/arm64: vgic_init: Cleanup reference to process_maintenance
        KVM: arm64: Fix order of vcpu_write_sys_reg() arguments
        KVM: arm/arm64: vgic: Fix source vcpu issues for GICv2 SGI
      701e39d0
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v4.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 772d4f84
      Linus Torvalds authored
      Pull iommu fixes from Joerg Roedel:
      
       - fix a compile warning in the AMD IOMMU driver with irq remapping
         disabled
      
       - fix for VT-d interrupt remapping and invalidation size (caused a
         BUG_ON when trying to invalidate more than 4GB)
      
       - build fix and a regression fix for broken graphics with old DTS for
         the rockchip iommu driver
      
       - a revert in the PCI window reservation code which fixes a regression
         with VFIO.
      
      * tag 'iommu-fixes-v4.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu: rockchip: fix building without CONFIG_OF
        iommu/vt-d: Use WARN_ON_ONCE instead of BUG_ON in qi_flush_dev_iotlb()
        iommu/vt-d: fix shift-out-of-bounds in bug checking
        iommu/dma: Move PCI window region reservation back into dma specific path.
        iommu/rockchip: Make clock handling optional
        iommu/amd: Hide unused iommu_table_lock
        iommu/vt-d: Fix usage of force parameter in intel_ir_reconfigure_irte()
      772d4f84
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9c48eb6a
      Linus Torvalds authored
      Pull x86 fix from Thomas Gleixner:
       "Unbreak the CPUID CPUID_8000_0008_EBX reload which got dropped when
        the evaluation of physical and virtual bits which uses the same CPUID
        leaf was moved out of get_cpu_cap()"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu: Restore CPUID_8000_0008_EBX reload
      9c48eb6a
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fe282c60
      Linus Torvalds authored
      Pull clocksource fixes from Thomas Gleixner:
       "The recent addition of the early TSC clocksource breaks on machines
        which have an unstable TSC because in case that TSC is disabled, then
        the clocksource selection logic falls back to the early TSC which is
        obviously bogus.
      
        That also unearthed a few robustness issues in the clocksource
        derating code which are addressed as well"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource: Rework stale comment
        clocksource: Consistent de-rate when marking unstable
        x86/tsc: Fix mark_tsc_unstable()
        clocksource: Initialize cs->wd_list
        clocksource: Allow clocksource_mark_unstable() on unregistered clocksources
        x86/tsc: Always unregister clocksource_tsc_early
      fe282c60
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 03b5f0c1
      Linus Torvalds authored
      Pull irq fix from Thomas Gleixner:
       "A single fix to prevent false positives in the spurious interrupt
        detector when more than a single demultiplex register is evaluated in
        the Qualcom irq combiner driver"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/qcom: Fix check for spurious interrupts
      03b5f0c1
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v4.17-2' of git://git.infradead.org/linux-platform-drivers-x86 · ee946c36
      Linus Torvalds authored
      Pull x86 platform driver fixes from Darren Hart:
      
       - We missed a case in the Dell config dependencies resulting in a
         possible bad configuration, resolve it by giving up on trying to keep
         DELL_LAPTOP visible in the menu and make it depend on DELL_SMBIOS.
      
       - Fix a null pointer dereference at module unload for the asus-wireless
         driver.
      
      * tag 'platform-drivers-x86-v4.17-2' of git://git.infradead.org/linux-platform-drivers-x86:
        platform/x86: Kconfig: Fix dell-laptop dependency chain.
        platform/x86: asus-wireless: Fix NULL pointer dereference
      ee946c36
    • Linus Torvalds's avatar
      Merge tag 'usb-4.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 8e95cb33
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some USB driver fixes for 4.17-rc4.
      
        The majority of them are some USB gadget fixes that missed my last
        pull request. The "largest" patch in here is a fix for the old visor
        driver that syzbot found 6 months or so ago and I finally remembered
        to fix it.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-4.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        Revert "usb: host: ehci: Use dma_pool_zalloc()"
        usb: typec: tps6598x: handle block reads separately with plain-I2C adapters
        usb: typec: tcpm: Release the role mux when exiting
        USB: Accept bulk endpoints with 1024-byte maxpacket
        xhci: Fix use-after-free in xhci_free_virt_device
        USB: serial: visor: handle potential invalid device configuration
        USB: serial: option: adding support for ublox R410M
        usb: musb: trace: fix NULL pointer dereference in musb_g_tx()
        usb: musb: host: fix potential NULL pointer dereference
        usb: gadget: composite Allow for larger configuration descriptors
        usb: dwc3: gadget: Fix list_del corruption in dwc3_ep_dequeue
        usb: dwc3: gadget: dwc3_gadget_del_and_unmap_request() can be static
        usb: dwc2: pci: Fix error return code in dwc2_pci_probe()
        usb: dwc2: WA for Full speed ISOC IN in DDMA mode.
        usb: dwc2: dwc2_vbus_supply_init: fix error check
        usb: gadget: f_phonet: fix pn_net_xmit()'s return type
      8e95cb33
  4. 05 May, 2018 15 commits
    • Anthoine Bourgeois's avatar
      KVM: x86: remove APIC Timer periodic/oneshot spikes · ecf08dad
      Anthoine Bourgeois authored
      Since the commit "8003c9ae: add APIC Timer periodic/oneshot mode VMX
      preemption timer support", a Windows 10 guest has some erratic timer
      spikes.
      
      Here the results on a 150000 times 1ms timer without any load:
      	  Before 8003c9ae | After 8003c9ae
      Max           1834us          |  86000us
      Mean          1100us          |   1021us
      Deviation       59us          |    149us
      Here the results on a 150000 times 1ms timer with a cpu-z stress test:
      	  Before 8003c9ae | After 8003c9ae
      Max          32000us          | 140000us
      Mean          1006us          |   1997us
      Deviation      140us          |  11095us
      
      The root cause of the problem is starting hrtimer with an expiry time
      already in the past can take more than 20 milliseconds to trigger the
      timer function.  It can be solved by forward such past timers
      immediately, rather than submitting them to hrtimer_start().
      In case the timer is periodic, update the target expiration and call
      hrtimer_start with it.
      
      v2: Check if the tsc deadline is already expired. Thank you Mika.
      v3: Execute the past timers immediately rather than submitting them to
      hrtimer_start().
      v4: Rearm the periodic timer with advance_periodic_target_expiration() a
      simpler version of set_target_expiration(). Thank you Paolo.
      
      Cc: Mika Penttilä <mika.penttila@nextfour.com>
      Cc: Wanpeng Li <kernellwp@gmail.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAnthoine Bourgeois <anthoine.bourgeois@blade-group.com>
      8003c9ae ("KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support")
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      ecf08dad
    • Radim Krčmář's avatar
      Merge tag 'kvmarm-fixes-for-4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm · f3351c60
      Radim Krčmář authored
      KVM/arm fixes for 4.17, take #2
      
      - Fix proxying of GICv2 CPU interface accesses
      - Fix crash when switching to BE
      - Track source vcpu git GICv2 SGIs
      - Fix an outdated bit of documentation
      f3351c60
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v4.17' of... · c1c07416
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - remove state comment in modpost
      
       - extend MAINTAINERS entry to cover modpost and more makefiles
      
       - fix missed building of SANCOV gcc-plugin
      
       - replace left-over 'bison' with $(YACC)
      
       - display short log when generating parer of genksyms
      
      * tag 'kbuild-fixes-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        genksyms: fix typo in parse.tab.{c,h} generation rules
        kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)
        gcc-plugins: fix build condition of SANCOV plugin
        MAINTAINERS: Update Kbuild entry with a few paths
        modpost: delete stale comment
      c1c07416
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 4a7a7729
      Linus Torvalds authored
      Pull clk fixes froom Stephen Boyd:
       "A handful of fixes for the stm32mp1 clk driver came in during the
        merge window for the driver that got merged in the merge window.
      
        Plus a warning fix for unused PM ops and a couple fixes for the meson
        clk driver clk names that went unnoticed with the regmap rework.
      
        There's also another fix in here for the mux rounding flag which
        wasn't doing what it said it did, but now it does"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: meson: meson8b: fix meson8b_cpu_clk parent clock name
        clk: meson: meson8b: fix meson8b_fclk_div3_div clock name
        clk: meson: drop meson_aoclk_gate_regmap_ops
        clk: meson: honor CLK_MUX_ROUND_CLOSEST in clk_regmap
        clk: honor CLK_MUX_ROUND_CLOSEST in generic clk mux
        clk: cs2000: mark resume function as __maybe_unused
        clk: stm32mp1: remove ck_apb_dbg clock
        clk: stm32mp1: set stgen_k clock as critical
        clk: stm32mp1: add missing tzc2 clock
        clk: stm32mp1: fix SAI3 & SAI4 clocks
        clk: stm32mp1: remove unused dfsdm_src[] const
        clk: stm32mp1: add missing static
      4a7a7729
    • Linus Torvalds's avatar
      Merge tag 'rproc-v4.17-1' of git://github.com/andersson/remoteproc · f9331473
      Linus Torvalds authored
      Pull remoteproc and rpmsg fixes from Bjorn Andersson:
      
       - fix screw-up when reversing boolean for rproc_stop()
      
       - add missing OF node refcounting dereferences
      
       - add missing MODULE_ALIAS in rpmsg_char
      
      * tag 'rproc-v4.17-1' of git://github.com/andersson/remoteproc:
        rpmsg: added MODULE_ALIAS for rpmsg_char
        remoteproc: qcom: Fix potential device node leaks
        remoteproc: fix crashed parameter logic on stop call
      f9331473
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.17-rc4' of git://people.freedesktop.org/~airlied/linux · c12fd0fe
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "vmwgfx, i915, vc4, vga dac fixes.
      
        This seems eerily quiet, so I expect it will explode next week or
        something.
      
        One i915 model firmware, two vmwgfx fixes, one vc4 fix and one bridge
        leak fix"
      
      * tag 'drm-fixes-for-v4.17-rc4' of git://people.freedesktop.org/~airlied/linux:
        drm/bridge: vga-dac: Fix edid memory leak
        drm/vc4: Make sure vc4_bo_{inc,dec}_usecnt() calls are balanced
        drm/i915/glk: Add MODULE_FIRMWARE for Geminilake
        drm/vmwgfx: Fix a buffer object leak
        drm/vmwgfx: Clean up fbdev modeset locking
      c12fd0fe
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.17-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 4b293907
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Some of the files in the tracing directory show file mode 0444 when
        they are writable by root. To fix the confusion, they should be 0644.
        Note, either case root can still write to them.
      
        Zhengyuan asked why I never applied that patch (the first one is from
        2014!). I simply forgot about it. /me lowers head in shame"
      
      * tag 'trace-v4.17-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Fix the file mode of stack tracer
        ftrace: Have set_graph_* files have normal file modes
      4b293907
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · eb4f959b
      Linus Torvalds authored
      Pull rdma fixes from Doug Ledford:
       "This is our first pull request of the rc cycle. It's not that it's
        been overly quiet, we were just waiting on a few things before sending
        this off.
      
        For instance, the 6 patch series from Intel for the hfi1 driver had
        actually been pulled in on Tuesday for a Wednesday pull request, only
        to have Jason notice something I missed, so we held off for some
        testing, and then on Thursday had to respin the series because the
        very first patch needed a minor fix (unnecessary cast is all).
      
        There is a sizable hns patch series in here, as well as a reasonably
        largish hfi1 patch series, then all of the lines of uapi updates are
        just the change to the new official Linux-OpenIB SPDX tag (a bunch of
        our files had what amounts to a BSD-2-Clause + MIT Warranty statement
        as their license as a result of the initial code submission years ago,
        and the SPDX folks decided it was unique enough to warrant a unique
        tag), then the typical mlx4 and mlx5 updates, and finally some cxgb4
        and core/cache/cma updates to round out the bunch.
      
        None of it was overly large by itself, but in the 2 1/2 weeks we've
        been collecting patches, it has added up :-/.
      
        As best I can tell, it's been through 0day (I got a notice about my
        last for-next push, but not for my for-rc push, but Jason seems to
        think that failure messages are prioritized and success messages not
        so much). It's also been through linux-next. And yes, we did notice in
        the context portion of the CMA query gid fix patch that there is a
        dubious BUG_ON() in the code, and have plans to audit our BUG_ON usage
        and remove it anywhere we can.
      
        Summary:
      
         - Various build fixes (USER_ACCESS=m and ADDR_TRANS turned off)
      
         - SPDX license tag cleanups (new tag Linux-OpenIB)
      
         - RoCE GID fixes related to default GIDs
      
         - Various fixes to: cxgb4, uverbs, cma, iwpm, rxe, hns (big batch),
           mlx4, mlx5, and hfi1 (medium batch)"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (52 commits)
        RDMA/cma: Do not query GID during QP state transition to RTR
        IB/mlx4: Fix integer overflow when calculating optimal MTT size
        IB/hfi1: Fix memory leak in exception path in get_irq_affinity()
        IB/{hfi1, rdmavt}: Fix memory leak in hfi1_alloc_devdata() upon failure
        IB/hfi1: Fix NULL pointer dereference when invalid num_vls is used
        IB/hfi1: Fix loss of BECN with AHG
        IB/hfi1 Use correct type for num_user_context
        IB/hfi1: Fix handling of FECN marked multicast packet
        IB/core: Make ib_mad_client_id atomic
        iw_cxgb4: Atomically flush per QP HW CQEs
        IB/uverbs: Fix kernel crash during MR deregistration flow
        IB/uverbs: Prevent reregistration of DM_MR to regular MR
        RDMA/mlx4: Add missed RSS hash inner header flag
        RDMA/hns: Fix a couple misspellings
        RDMA/hns: Submit bad wr
        RDMA/hns: Update assignment method for owner field of send wqe
        RDMA/hns: Adjust the order of cleanup hem table
        RDMA/hns: Only assign dqpn if IB_QP_PATH_DEST_QPN bit is set
        RDMA/hns: Remove some unnecessary attr_mask judgement
        RDMA/hns: Only assign mtu if IB_QP_PATH_MTU bit is set
        ...
      eb4f959b
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20180504' of git://git.kernel.dk/linux-block · 2f50037a
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A collection of fixes that should to into this release. This contains:
      
         - Set of bcache fixes from Coly, fixing regression in patches that
           went into this series.
      
         - Set of NVMe fixes by way of Keith.
      
         - Set of bdi related fixes, one from Jan and two from Tetsuo Handa,
           fixing various issues around device addition/removal.
      
         - Two block inflight fixes from Omar, fixing issues around the
           transition to using tags for blk-mq inflight accounting that we
           did a few releases ago"
      
      * tag 'for-linus-20180504' of git://git.kernel.dk/linux-block:
        bdi: Fix oops in wb_workfn()
        nvmet: switch loopback target state to connecting when resetting
        nvme/multipath: Fix multipath disabled naming collisions
        nvme/multipath: Disable runtime writable enabling parameter
        nvme: Set integrity flag for user passthrough commands
        nvme: fix potential memory leak in option parsing
        bdi: Fix use after free bug in debugfs_remove()
        bdi: wake up concurrent wb_shutdown() callers.
        bcache: use pr_info() to inform duplicated CACHE_SET_IO_DISABLE set
        bcache: set dc->io_disable to true in conditional_stop_bcache_device()
        bcache: add wait_for_kthread_stop() in bch_allocator_thread()
        bcache: count backing device I/O error for writeback I/O
        bcache: set CACHE_SET_IO_DISABLE in bch_cached_dev_error()
        bcache: store disk name in struct cache and struct cached_dev
        blk-mq: fix sysfs inflight counter
        blk-mq: count allocated but not started requests in iostats inflight
      2f50037a
    • Linus Torvalds's avatar
      Merge tag 'xfs-4.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 2e171ffc
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "I've got one more bug fix for xfs for 4.17-rc4, which caps the amount
        of data we try to handle in one dedupe request so that userspace can't
        livelock the kernel.
      
        This series has been run through a full xfstests run during the week
        and through a quick xfstests run against this morning's master, with
        no ajor failures reported.
      
        Summary:
      
        - Cap the maximum length of a deduplication request at MAX_RW_COUNT/2
          to avoid kernel livelock due to excessively large IO requests"
      
      * tag 'xfs-4.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: cap the length of deduplication requests
      2e171ffc
    • Linus Torvalds's avatar
      Merge tag 'for-4.17-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 4148d388
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "Two regression fixes and one fix for stable"
      
      * tag 'for-4.17-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Btrfs: send, fix missing truncate for inode with prealloc extent past eof
        btrfs: Take trans lock before access running trans in check_delayed_ref
        btrfs: Fix wrong first_key parameter in replace_path
      4148d388
    • Mauro Rossi's avatar
      genksyms: fix typo in parse.tab.{c,h} generation rules · 0da7e432
      Mauro Rossi authored
      'quet' is replaced by 'quiet' in scripts/genksyms/Makefile
      Signed-off-by: default avatarMauro Rossi <issor.oruam@gmail.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      0da7e432
    • Masahiro Yamada's avatar
      kbuild: replace hardcoded bison in cmd_bison_h with $(YACC) · d59fbbd0
      Masahiro Yamada authored
      Commit 73a4f6db ("kbuild: add LEX and YACC variables") missed to
      update cmd_bison_h somehow.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      d59fbbd0
    • Masahiro Yamada's avatar
      gcc-plugins: fix build condition of SANCOV plugin · 642ef99b
      Masahiro Yamada authored
      Since commit d677a4d6 ("Makefile: support flag
      -fsanitizer-coverage=trace-cmp"), you miss to build the SANCOV
      plugin under some circumstances.
      
        CONFIG_KCOV=y
        CONFIG_KCOV_ENABLE_COMPARISONS=y
        Your compiler does not support -fsanitize-coverage=trace-pc
        Your compiler does not support -fsanitize-coverage=trace-cmp
      
      Under this condition, $(CFLAGS_KCOV) is not empty but contains a
      space, so the following ifeq-conditional is false.
      
          ifeq ($(CFLAGS_KCOV),)
      
      Then, scripts/Makefile.gcc-plugins misses to add sancov_plugin.so to
      gcc-plugin-y while the SANCOV plugin is necessary as an alternative
      means.
      
      Fixes: d677a4d6 ("Makefile: support flag -fsanitizer-coverage=trace-cmp")
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      642ef99b
    • Rasmus Villemoes's avatar
      MAINTAINERS: Update Kbuild entry with a few paths · 1cd4023b
      Rasmus Villemoes authored
      I managed to send some modpost patches to old addresses of both
      Masahiro and Michal, and omitted linux-kbuild from cc, because my
      tried and trusted scripts/get_maintainer wrapper failed me. Add the
      modpost directory to the MAINTAINERS entry, and while at it make the
      Makefile glob match scripts/Makefile itself, and add one matching the
      Kbuild.include file as well.
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      1cd4023b