1. 27 May, 2016 8 commits
    • Linus Torvalds's avatar
      Merge git://git.infradead.org/intel-iommu · 25662785
      Linus Torvalds authored
      Pull intel IOMMU updates from David Woodhouse:
       "This patchset improves the scalability of the Intel IOMMU code by
        resolving two spinlock bottlenecks and eliminating the linearity of
        the IOVA allocator, yielding up to ~5x performance improvement and
        approaching 'iommu=off' performance"
      
      * git://git.infradead.org/intel-iommu:
        iommu/vt-d: Use per-cpu IOVA caching
        iommu/iova: introduce per-cpu caching to iova allocation
        iommu/vt-d: change intel-iommu to use IOVA frame numbers
        iommu/vt-d: avoid dev iotlb logic for domains with no dev iotlbs
        iommu/vt-d: only unmap mapped entries
        iommu/vt-d: correct flush_unmaps pfn usage
        iommu/vt-d: per-cpu deferred invalidation queues
        iommu/vt-d: refactoring of deferred flush entries
      25662785
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · e28e909c
      Linus Torvalds authored
      Pull second batch of KVM updates from Radim Krčmář:
       "General:
      
         - move kvm_stat tool from QEMU repo into tools/kvm/kvm_stat (kvm_stat
           had nothing to do with QEMU in the first place -- the tool only
           interprets debugfs)
      
         - expose per-vm statistics in debugfs and support them in kvm_stat
           (KVM always collected per-vm statistics, but they were summarised
           into global statistics)
      
        x86:
      
         - fix dynamic APICv (VMX was improperly configured and a guest could
           access host's APIC MSRs, CVE-2016-4440)
      
         - minor fixes
      
        ARM changes from Christoffer Dall:
      
         - new vgic reimplementation of our horribly broken legacy vgic
           implementation.  The two implementations will live side-by-side
           (with the new being the configured default) for one kernel release
           and then we'll remove the legacy one.
      
         - fix for a non-critical issue with virtual abort injection to guests"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (70 commits)
        tools: kvm_stat: Add comments
        tools: kvm_stat: Introduce pid monitoring
        KVM: Create debugfs dir and stat files for each VM
        MAINTAINERS: Add kvm tools
        tools: kvm_stat: Powerpc related fixes
        tools: Add kvm_stat man page
        tools: Add kvm_stat vm monitor script
        kvm:vmx: more complete state update on APICv on/off
        KVM: SVM: Add more SVM_EXIT_REASONS
        KVM: Unify traced vector format
        svm: bitwise vs logical op typo
        KVM: arm/arm64: vgic-new: Synchronize changes to active state
        KVM: arm/arm64: vgic-new: enable build
        KVM: arm/arm64: vgic-new: implement mapped IRQ handling
        KVM: arm/arm64: vgic-new: Wire up irqfd injection
        KVM: arm/arm64: vgic-new: Add vgic_v2/v3_enable
        KVM: arm/arm64: vgic-new: vgic_init: implement map_resources
        KVM: arm/arm64: vgic-new: vgic_init: implement vgic_init
        KVM: arm/arm64: vgic-new: vgic_init: implement vgic_create
        KVM: arm/arm64: vgic-new: vgic_init: implement kvm_vgic_hyp_init
        ...
      e28e909c
    • Linus Torvalds's avatar
      Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · dc03c0f9
      Linus Torvalds authored
      Pull misc kbuild updates from Michal Marek:
       "This is the non-critical part of kbuild:
      
         - Coccinelle fixes, one semantic patch less in this round [Vaishali
           Thakkar, Wolfram Sang, Kees Cook]
      
         - rpm-pkg support for (open)SUSE's update-bootloader [Jiří Kosian]
      
         - rpm-pkg restored support for $RPMOPTS [Srinivas Pandruvada]
      
         - deb-pkg fixes for the linux-headers package [Bjørn Mork, Azriel
           Samson]"
      
      * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
        coccicheck: Fix missing 0 index in kill loop
        scripts/package/Makefile: rpmbuild add support of RPMOPTS
        builddeb: fix missing headers in linux-headers package
        builddeb: include objtool binary in headers package
        kbuild/mkspec: support 'update-bootloader'-based systems
        scripts: coccinelle: remove check to move constants to right
        Coccinelle: setup_timer: Add space in front of parentheses
      dc03c0f9
    • Linus Torvalds's avatar
      Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · f429d355
      Linus Torvalds authored
      Pull kconfig update from Michal Marek:
      
       - fix for behavior of tristate choice items and fix for documentation
         of existing kconfig behavior [Dirk Gouders]
      
       - more helpful "unexpected data" kconfig warning [Paul Bolle]
      
      * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
        kconfig/symbol.c: handle choice_values that depend on 'm' symbols
        kconfig-language: elaborate on the type of a choice
        kconfig-language: fix comment on dependency-generated menu structures.
        kconfig: add unexpected data itself to warning
      f429d355
    • Linus Torvalds's avatar
      Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · 5b26fc88
      Linus Torvalds authored
      Pull kbuild updates from Michal Marek:
      
       - new option CONFIG_TRIM_UNUSED_KSYMS which does a two-pass build and
         unexports symbols which are not used in the current config [Nicolas
         Pitre]
      
       - several kbuild rule cleanups [Masahiro Yamada]
      
       - warning option adjustments for gcov etc [Arnd Bergmann]
      
       - a few more small fixes
      
      * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (31 commits)
        kbuild: move -Wunused-const-variable to W=1 warning level
        kbuild: fix if_change and friends to consider argument order
        kbuild: fix adjust_autoksyms.sh for modules that need only one symbol
        kbuild: fix ksym_dep_filter when multiple EXPORT_SYMBOL() on the same line
        gcov: disable -Wmaybe-uninitialized warning
        gcov: disable tree-loop-im to reduce stack usage
        gcov: disable for COMPILE_TEST
        Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES
        Kbuild: change CC_OPTIMIZE_FOR_SIZE definition
        kbuild: forbid kernel directory to contain spaces and colons
        kbuild: adjust ksym_dep_filter for some cmd_* renames
        kbuild: Fix dependencies for final vmlinux link
        kbuild: better abstract vmlinux sequential prerequisites
        kbuild: fix call to adjust_autoksyms.sh when output directory specified
        kbuild: Get rid of KBUILD_STR
        kbuild: rename cmd_as_s_S to cmd_cpp_s_S
        kbuild: rename cmd_cc_i_c to cmd_cpp_i_c
        kbuild: drop redundant "PHONY += FORCE"
        kbuild: delete unnecessary "@:"
        kbuild: mark help target as PHONY
        ...
      5b26fc88
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · e12fab28
      Linus Torvalds authored
      Merge fixes from Andrew Morton:
       "10 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        drivers/pinctrl/intel/pinctrl-baytrail.c: fix build with gcc-4.4
        update "mm/zsmalloc: don't fail if can't create debugfs info"
        dma-debug: avoid spinlock recursion when disabling dma-debug
        mm: oom_reaper: remove some bloat
        memcg: fix mem_cgroup_out_of_memory() return value.
        ocfs2: fix improper handling of return errno
        mm: slub: remove unused virt_to_obj()
        mm: kasan: remove unused 'reserved' field from struct kasan_alloc_meta
        mm: make CONFIG_DEFERRED_STRUCT_PAGE_INIT depends on !FLATMEM explicitly
        seqlock: fix raw_read_seqcount_latch()
      e12fab28
    • Linus Torvalds's avatar
      Merge tag 'dax-locking-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 478a1469
      Linus Torvalds authored
      Pull DAX locking updates from Ross Zwisler:
       "Filesystem DAX locking for 4.7
      
         - We use a bit in an exceptional radix tree entry as a lock bit and
           use it similarly to how page lock is used for normal faults.  This
           fixes races between hole instantiation and read faults of the same
           index.
      
         - Filesystem DAX PMD faults are disabled, and will be re-enabled when
           PMD locking is implemented"
      
      * tag 'dax-locking-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        dax: Remove i_mmap_lock protection
        dax: Use radix tree entry lock to protect cow faults
        dax: New fault locking
        dax: Allow DAX code to replace exceptional entries
        dax: Define DAX lock bit for radix tree exceptional entry
        dax: Make huge page handling depend of CONFIG_BROKEN
        dax: Fix condition for filling of PMD holes
      478a1469
    • Linus Torvalds's avatar
      Merge tag 'dax-misc-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 315227f6
      Linus Torvalds authored
      Pull misc DAX updates from Vishal Verma:
       "DAX error handling for 4.7
      
         - Until now, dax has been disabled if media errors were found on any
           device.  This enables the use of DAX in the presence of these
           errors by making all sector-aligned zeroing go through the driver.
      
         - The driver (already) has the ability to clear errors on writes that
           are sent through the block layer using 'DSMs' defined in ACPI 6.1.
      
        Other misc changes:
      
         - When mounting DAX filesystems, check to make sure the partition is
           page aligned.  This is a requirement for DAX, and previously, we
           allowed such unaligned mounts to succeed, but subsequent
           reads/writes would fail.
      
         - Misc/cleanup fixes from Jan that remove unused code from DAX
           related to zeroing, writeback, and some size checks"
      
      * tag 'dax-misc-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        dax: fix a comment in dax_zero_page_range and dax_truncate_page
        dax: for truncate/hole-punch, do zeroing through the driver if possible
        dax: export a low-level __dax_zero_page_range helper
        dax: use sb_issue_zerout instead of calling dax_clear_sectors
        dax: enable dax in the presence of known media errors (badblocks)
        dax: fallback from pmd to pte on error
        block: Update blkdev_dax_capable() for consistency
        xfs: Add alignment check for DAX mount
        ext2: Add alignment check for DAX mount
        ext4: Add alignment check for DAX mount
        block: Add bdev_dax_supported() for dax mount checks
        block: Add vfs_msg() interface
        dax: Remove redundant inode size checks
        dax: Remove pointless writeback from dax_do_io()
        dax: Remove zeroing from dax_io()
        dax: Remove dead zeroing code from fault handlers
        ext2: Avoid DAX zeroing to corrupt data
        ext2: Fix block zeroing in ext2_get_blocks() for DAX
        dax: Remove complete_unwritten argument
        DAX: move RADIX_DAX_ definitions to dax.c
      315227f6
  2. 26 May, 2016 24 commits
  3. 25 May, 2016 8 commits
    • Jann Horn's avatar
      Yama: fix double-spinlock and user access in atomic context · dca6b414
      Jann Horn authored
      Commit 8a56038c ("Yama: consolidate error reporting") causes lockups
      when someone hits a Yama denial. Call chain:
      
      process_vm_readv -> process_vm_rw -> process_vm_rw_core -> mm_access
      -> ptrace_may_access
      task_lock(...) is taken
      __ptrace_may_access -> security_ptrace_access_check
      -> yama_ptrace_access_check -> report_access -> kstrdup_quotable_cmdline
      -> get_cmdline -> access_process_vm -> get_task_mm
      task_lock(...) is taken again
      
      task_lock(p) just calls spin_lock(&p->alloc_lock), so at this point,
      spin_lock() is called on a lock that is already held by the current
      process.
      
      Also: Since the alloc_lock is a spinlock, sleeping inside
      security_ptrace_access_check hooks is probably not allowed at all? So it's
      not even possible to print the cmdline from in there because that might
      involve paging in userspace memory.
      
      It would be tempting to rewrite ptrace_may_access() to drop the alloc_lock
      before calling the LSM, but even then, ptrace_may_access() itself might be
      called from various contexts in which you're not allowed to sleep; for
      example, as far as I understand, to be able to hold a reference to another
      task, usually an RCU read lock will be taken (see e.g. kcmp() and
      get_robust_list()), so that also prohibits sleeping. (And using e.g. FUSE,
      a user can cause pagefault handling to take arbitrary amounts of time -
      see https://bugs.chromium.org/p/project-zero/issues/detail?id=808.)
      
      Therefore, AFAIK, in order to print the name of a process below
      security_ptrace_access_check(), you'd have to either grab a reference to
      the mm_struct and defer the access violation reporting or just use the
      "comm" value that's stored in kernelspace and accessible without big
      complications. (Or you could try to use some kind of atomic remote VM
      access that fails if the memory isn't paged in, similar to
      copy_from_user_inatomic(), and if necessary fall back to comm, but
      that'd be kind of ugly because the comm/cmdline choice would look
      pretty random to the user.)
      
      Fix it by deferring reporting of the access violation until current
      exits kernelspace the next time.
      
      v2: Don't oops on PTRACE_TRACEME, call report_access under
      task_lock(current). Also fix nonsensical comment. And don't use
      GPF_ATOMIC for memory allocation with no locks held.
      This patch is tested both for ptrace attach and ptrace traceme.
      
      Fixes: 8a56038c ("Yama: consolidate error reporting")
      Signed-off-by: default avatarJann Horn <jann@thejh.net>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
      dca6b414
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c4a34600
      Linus Torvalds authored
      Pull objtool build fix from Ingo Molnar:
       "An libtool fix for older libelf versions"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Allow building with older libelf
      c4a34600
    • Yan, Zheng's avatar
      ceph: fix wake_up_session_cb() · e5360309
      Yan, Zheng authored
      We should reset i_requested_max_size before waking the waiters.
      (zero i_requested_max_size make waiter re-request the max size)
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      e5360309
    • Yan, Zheng's avatar
      ceph: don't use truncate_pagecache() to invalidate read cache · 9abd4db7
      Yan, Zheng authored
      truncate_pagecache() drops dirty pages, it's dangerous to use it
      to invalidate read cache. Besides, we shouldn't start invalidating
      read cache while there are buffer writers. Because buffer writers
      may add dirty pages later.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      9abd4db7
    • Yan, Zheng's avatar
      b109eec6
    • Yan, Zheng's avatar
      ceph: handle interrupted ceph_writepage() · ad15ec06
      Yan, Zheng authored
      writepage() can be interrupted when it's called by direct memory
      reclaimer (the direct memory relaimer is killed). To avoid lossing
      data, we redirty the page.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      ad15ec06
    • Yan, Zheng's avatar
      ceph: make ceph_update_writeable_page() uninterruptible · a78bbd4b
      Yan, Zheng authored
      ceph_update_writeable_page() is used by ceph_write_begin(). It beaks
      atomicity of write operation if it's interruptible.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      a78bbd4b
    • Yan, Zheng's avatar
      libceph: make ceph_osdc_wait_request() uninterruptible · 0e76abf2
      Yan, Zheng authored
      Ceph_osdc_wait_request() is used when cephfs issues sync IO. In most
      cases, the sync IO should be uninterruptible. The fix is use killale
      wait function in ceph_osdc_wait_request().
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      0e76abf2