Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Oct 05, 2018
  2. Oct 04, 2018
    • Greg Kroah-Hartman's avatar
      Merge tag 'drm-fixes-2018-10-05' of git://anongit.freedesktop.org/drm/drm · befad944
      Greg Kroah-Hartman authored
      Dave writes:
        "amdgpu and two core fixes
      
         Two fixes for amdgpu:
         one corrects a use of process->mm
         one fix for display code race condition that can result in a crash
      
         Two core fixes:
         One for a use-after-free in the leasing code
         One for a cma/fbdev crash."
      
      * tag 'drm-fixes-2018-10-05' of git://anongit.freedesktop.org/drm/drm:
        drm/amdkfd: Fix incorrect use of process->mm
        drm/amd/display: Signal hw_done() after waiting for flip_done()
        drm/cma-helper: Fix crash in fbdev error path
        drm: fix use-after-free read in drm_mode_create_lease_ioctl()
      befad944
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · bdf800c6
      Dave Airlie authored
      
      - Fix an ordering issue in DC with respect to atomic flips that could result
        in a crash
      - Fix incorrect use of process->mm in KFD
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1538668374-22334-1-git-send-email-alexander.deucher@amd.com
      bdf800c6
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2018-10-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 3a9df1e9
      Dave Airlie authored
      
      drm-misc-fixes for v4.19-rc7:
      - Fix use-after-free in drm_mode_create_lease_ioctl()
      - Fix crash in fbdev error path.
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/13b2c3ac-9a96-710e-ceb9-890af164f10e@linux.intel.com
      3a9df1e9
    • Greg Kroah-Hartman's avatar
      Merge tag 'ovl-fixes-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · 010bd965
      Greg Kroah-Hartman authored
      Miklos writes:
        "overlayfs fixes for 4.19-rc7
      
         This update fixes a couple of regressions in the stacked file update
         added in this cycle, as well as some older bugs uncovered by
         syzkaller.
      
         There's also one trivial naming change that touches other parts of
         the fs subsystem."
      
      * tag 'ovl-fixes-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: fix format of setxattr debug
        ovl: fix access beyond unterminated strings
        ovl: make symbol 'ovl_aops' static
        vfs: swap names of {do,vfs}_clone_file_range()
        ovl: fix freeze protection bypass in ovl_clone_file_range()
        ovl: fix freeze protection bypass in ovl_write_iter()
        ovl: fix memory leak on unlink of indexed file
      010bd965
    • Greg Kroah-Hartman's avatar
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · ac0657ed
      Greg Kroah-Hartman authored
      Russell writes:
        "A couple of small ARM fixes from Stefan and Thomas:
         - Adding the io_pgetevents syscall
         - Fixing a bounds check in pci_ioremap_io()"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8799/1: mm: fix pci_ioremap_io() offset check
        ARM: 8787/1: wire up io_pgetevents syscall
      ac0657ed
    • Greg Kroah-Hartman's avatar
      Merge tag 'drm-fixes-2018-10-04' of git://anongit.freedesktop.org/drm/drm · 10be83cc
      Greg Kroah-Hartman authored
      Dave writes:
        "drm exynos, tda9950 and intel fixes
      
         3 i915 fixes:
           compressed error handling zlib fix
           compiler warning cleanup
           and a minor code cleanup
      
         2 tda9950:
           Two fixes for the HDMI CEC
      
         1 exynos:
           A fix required for IOMMU interaction."
      
      * tag 'drm-fixes-2018-10-04' of git://anongit.freedesktop.org/drm/drm:
        drm/i915: Handle incomplete Z_FINISH for compressed error states
        drm/i915: Avoid compiler warning for maybe unused gu_misc_iir
        drm/i915: Do not redefine the has_csr parameter.
        drm/exynos: Use selected dma_dev default iommu domain instead of a fake one
        drm/i2c: tda9950: set MAX_RETRIES for errors only
        drm/i2c: tda9950: fix timeout counter check
      10be83cc
    • Greg Kroah-Hartman's avatar
      Merge tag 'xfs-fixes-for-4.19-rc6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 1b0350c3
      Greg Kroah-Hartman authored
      Dave writes:
        "XFS fixes for 4.19-rc6
      
         Accumlated regression and bug fixes for 4.19-rc6, including:
      
         o make iomap correctly mark dirty pages for sub-page block sizes
         o fix regression in handling extent-to-btree format conversion errors
         o fix torn log wrap detection for new logs
         o various corrupt inode detection fixes
         o various delalloc state fixes
         o cleanup all the missed transaction cancel cases missed from changes merged
           in 4.19-rc1
         o fix lockdep false positive on transaction allocation
         o fix locking and reference counting on buffer log items"
      
      * tag 'xfs-fixes-for-4.19-rc6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: fix error handling in xfs_bmap_extents_to_btree
        iomap: set page dirty after partial delalloc on mkwrite
        xfs: remove invalid log recovery first/last cycle check
        xfs: validate inode di_forkoff
        xfs: skip delalloc COW blocks in xfs_reflink_end_cow
        xfs: don't treat unknown di_flags2 as corruption in scrub
        xfs: remove duplicated include from alloc.c
        xfs: don't bring in extents in xfs_bmap_punch_delalloc_range
        xfs: fix transaction leak in xfs_reflink_allocate_cow()
        xfs: avoid lockdep false positives in xfs_trans_alloc
        xfs: refactor xfs_buf_log_item reference count handling
        xfs: clean up xfs_trans_brelse()
        xfs: don't unlock invalidated buf on aborted tx commit
        xfs: remove last of unnecessary xfs_defer_cancel() callers
        xfs: don't crash the vfs on a garbage inline symlink
      1b0350c3
    • Greg Kroah-Hartman's avatar
      Merge tag 'riscv-for-linus-4.19-rc7' of... · d2467adb
      Greg Kroah-Hartman authored
      Merge tag 'riscv-for-linus-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux
      
      Palmer writes:
        "A Single RISC-V Fix for 4.19-rc7
      
         This tag contains a single patch that managed to get lost in the
         shuffle, which explains why it's so late.  This single line has been
         floating around in various patch sets for months, and fixes our DMA32
         region."
      
      * tag 'riscv-for-linus-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
        RISCV: Fix end PFN for low memory
      d2467adb
    • Felix Kuehling's avatar
      drm/amdkfd: Fix incorrect use of process->mm · 11b29c9e
      Felix Kuehling authored
      
      This mm_struct pointer should never be dereferenced. If running in
      a user thread, just use current->mm. If running in a kernel worker
      use get_task_mm to get a safe reference to the mm_struct.
      
      Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      11b29c9e
    • Shirish S's avatar
      drm/amd/display: Signal hw_done() after waiting for flip_done() · 987bf116
      Shirish S authored
      
      In amdgpu_dm_commit_tail(), wait until flip_done() is signaled before
      we signal hw_done().
      
      [Why]
      
      This is to temporarily address a paging error that occurs when a
      nonblocking commit contends with another commit, particularly in a
      mirrored display configuration where at least 2 CRTCs are updated.
      The error occurs in drm_atomic_helper_wait_for_flip_done(), when we
      attempt to access the contents of new_crtc_state->commit.
      
      Here's the sequence for a mirrored 2 display setup (irrelevant steps
      left out for clarity):
      
      **THREAD 1**                        | **THREAD 2**
                                          |
      Initialize atomic state for flip    |
                                          |
      Queue worker                        |
                                         ...
      
                                          | Do work for flip
                                          |
                                          | Signal hw_done() on CRTC 1
                                          | Signal hw_done() on CRTC 2
                                          |
                                          | Wait for flip_done() on CRTC 1
      
                                      <---- **PREEMPTED BY THREAD 1**
      
      Initialize atomic state for cursor  |
      update (1)                          |
                                          |
      Do cursor update work on both CRTCs |
                                          |
      Clear atomic state (2)              |
      **DONE**                            |
                                         ...
                                          |
                                          | Wait for flip_done() on CRTC 2
                                          | *ERROR*
                                          |
      
      The issue starts with (1). When the atomic state is initialized, the
      current CRTC states are duplicated to be the new_crtc_states, and
      referenced to be the old_crtc_states. (The new_crtc_states are to be
      filled with update data.)
      
      Some things to note:
      
      * Due to the mirrored configuration, the cursor updates on both CRTCs.
      
      * At this point, the pflip IRQ has already been handled, and flip_done
        signaled on all CRTCs. The cursor commit can therefore continue.
      
      * The old_crtc_states used by the cursor update are the **same states**
        as the new_crtc_states used by the flip worker.
      
      At (2), the old_crtc_state is freed (*), and the cursor commit
      completes. We then context switch back to the flip worker, where we
      attempt to access the new_crtc_state->commit object. This is
      problematic, as this state has already been freed.
      
      (*) Technically, 'state->crtcs[i].state' is freed, which was made to
          reference old_crtc_state in drm_atomic_helper_swap_state()
      
      [How]
      
      By moving hw_done() after wait_for_flip_done(), we're guaranteed that
      the new_crtc_state (from the flip worker's perspective) still exists.
      This is because any other commit will be blocked, waiting for the
      hw_done() signal.
      
      Note that both the i915 and imx drivers have this sequence flipped
      already, masking this problem.
      
      Signed-off-by: default avatarShirish S <shirish.s@amd.com>
      Signed-off-by: default avatarLeo Li <sunpeng.li@amd.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      987bf116
    • Paolo Bonzini's avatar
      kvm: nVMX: fix entry with pending interrupt if APICv is enabled · 7e712684
      Paolo Bonzini authored
      Commit b5861e5c introduced a check on
      the interrupt-window and NMI-window CPU execution controls in order to
      inject an external interrupt vmexit before the first guest instruction
      executes.  However, when APIC virtualization is enabled the host does not
      need a vmexit in order to inject an interrupt at the next interrupt window;
      instead, it just places the interrupt vector in RVI and the processor will
      inject it as soon as possible.  Therefore, on machines with APICv it is
      not enough to check the CPU execution controls: the same scenario can also
      happen if RVI>vPPR.
      
      Fixes: b5861e5c
      
      
      Reviewed-by: default avatarNikita Leshchenko <nikita.leshchenko@oracle.com>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Liran Alon <liran.alon@oracle.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7e712684
    • Miklos Szeredi's avatar
      ovl: fix format of setxattr debug · 1a8f8d2a
      Miklos Szeredi authored
      
      Format has a typo: it was meant to be "%.*s", not "%*s".  But at some point
      callers grew nonprintable values as well, so use "%*pE" instead with a
      maximized length.
      
      Reported-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Fixes: 3a1e819b ("ovl: store file handle of lower inode on copy up")
      Cc: <stable@vger.kernel.org> # v4.12
      1a8f8d2a
    • Amir Goldstein's avatar
      ovl: fix access beyond unterminated strings · 601350ff
      Amir Goldstein authored
      
      KASAN detected slab-out-of-bounds access in printk from overlayfs,
      because string format used %*s instead of %.*s.
      
      > BUG: KASAN: slab-out-of-bounds in string+0x298/0x2d0 lib/vsprintf.c:604
      > Read of size 1 at addr ffff8801c36c66ba by task syz-executor2/27811
      >
      > CPU: 0 PID: 27811 Comm: syz-executor2 Not tainted 4.19.0-rc5+ #36
      ...
      >  printk+0xa7/0xcf kernel/printk/printk.c:1996
      >  ovl_lookup_index.cold.15+0xe8/0x1f8 fs/overlayfs/namei.c:689
      
      Reported-by: default avatar <syzbot+376cea2b0ef340db3dd4@syzkaller.appspotmail.com>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Fixes: 359f392c ("ovl: lookup index entry for copy up origin")
      Cc: <stable@vger.kernel.org> # v4.13
      601350ff
    • Paolo Bonzini's avatar
      KVM: VMX: hide flexpriority from guest when disabled at the module level · 2cf7ea9f
      Paolo Bonzini authored
      As of commit 8d860bbe
      
       ("kvm: vmx: Basic APIC virtualization controls
      have three settings"), KVM will disable VIRTUALIZE_APIC_ACCESSES when
      a nested guest writes APIC_BASE MSR and kvm-intel.flexpriority=0,
      whereas previously KVM would allow a nested guest to enable
      VIRTUALIZE_APIC_ACCESSES so long as it's supported in hardware.  That is,
      KVM now advertises VIRTUALIZE_APIC_ACCESSES to a guest but doesn't
      (always) allow setting it when kvm-intel.flexpriority=0, and may even
      initially allow the control and then clear it when the nested guest
      writes APIC_BASE MSR, which is decidedly odd even if it doesn't cause
      functional issues.
      
      Hide the control completely when the module parameter is cleared.
      
      reported-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Fixes: 8d860bbe
      
       ("kvm: vmx: Basic APIC virtualization controls have three settings")
      Cc: Jim Mattson <jmattson@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2cf7ea9f
    • Sean Christopherson's avatar
      KVM: VMX: check for existence of secondary exec controls before accessing · fd6b6d9b
      Sean Christopherson authored
      
      Return early from vmx_set_virtual_apic_mode() if the processor doesn't
      support VIRTUALIZE_APIC_ACCESSES or VIRTUALIZE_X2APIC_MODE, both of
      which reside in SECONDARY_VM_EXEC_CONTROL.  This eliminates warnings
      due to VMWRITEs to SECONDARY_VM_EXEC_CONTROL (VMCS field 401e) failing
      on processors without secondary exec controls.
      
      Remove the similar check for TPR shadowing as it is incorporated in the
      flexpriority_enabled check and the APIC-related code in
      vmx_update_msr_bitmap() is further gated by VIRTUALIZE_X2APIC_MODE.
      
      Reported-by: default avatarGerhard Wiesinger <redhat@wiesinger.com>
      Fixes: 8d860bbe
      
       ("kvm: vmx: Basic APIC virtualization controls have three settings")
      Cc: Jim Mattson <jmattson@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fd6b6d9b
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Avoid crash from THP collapse during radix page fault · 6579804c
      Paul Mackerras authored
      Commit 71d29f43 ("KVM: PPC: Book3S HV: Don't use compound_order to
      determine host mapping size", 2018-09-11) added a call to 
      __find_linux_pte() and a dereference of the returned PTE pointer to the
      radix page fault path in the common case where the page is normal
      system memory.  Previously, __find_linux_pte() was only called for
      mappings to physical addresses which don't have a page struct (e.g.
      memory-mapped I/O) or where the page struct is marked as reserved
      memory.
      
      This exposes us to the possibility that the returned PTE pointer
      could be NULL, for example in the case of a concurrent THP collapse
      operation.  Dereferencing the returned NULL pointer causes a host
      crash.
      
      To fix this, we check for NULL, and if it is NULL, we retry the
      operation by returning to the guest, with the expectation that it
      will generate the same page fault again (unless of course it has
      been fixed up by another CPU in the meantime).
      
      Fixes: 71d29f43
      
       ("KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size")
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      6579804c
  3. Oct 03, 2018