Skip to content
  1. May 05, 2020
    • Chris Wilson's avatar
      drm/i915: Avoid dereferencing a dead context · 30523408
      Chris Wilson authored
      Once the intel_context is closed, the GEM context may be freed and so
      the link from intel_context.gem_context is invalid.
      
      <3>[  219.782944] BUG: KASAN: use-after-free in intel_engine_coredump_alloc+0x1bc3/0x2250 [i915]
      <3>[  219.782996] Read of size 8 at addr ffff8881d7dff0b8 by task kworker/0:1/12
      
      <4>[  219.783052] CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: G     U            5.7.0-rc2-g1f3ffd7683d54-kasan_118+ #1
      <4>[  219.783055] Hardware name: System manufacturer System Product Name/Z170 PRO GAMING, BIOS 3402 04/26/2017
      <4>[  219.783105] Workqueue: events heartbeat [i915]
      <4>[  219.783109] Call Trace:
      <4>[  219.783113]  <IRQ>
      <4>[  219.783119]  dump_stack+0x96/0xdb
      <4>[  219.783177]  ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915]
      <4>[  219.783182]  print_address_description.constprop.6+0x16/0x310
      <4>[  219.783239]  ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915]
      <4>[  219.783295]  ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915]
      <4>[  219.783300]  __kasan_report+0x137/0x190
      <4>[  219.783359]  ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915]
      <4>[  219.783366]  kasan_report+0x32/0x50
      <4>[  219.783426]  intel_engine_coredump_alloc+0x1bc3/0x2250 [i915]
      <4>[  219.783481]  execlists_reset+0x39c/0x13d0 [i915]
      <4>[  219.783494]  ? mark_held_locks+0x9e/0xe0
      <4>[  219.783546]  ? execlists_hold+0xfc0/0xfc0 [i915]
      <4>[  219.783551]  ? lockdep_hardirqs_on+0x348/0x5f0
      <4>[  219.783557]  ? _raw_spin_unlock_irqrestore+0x34/0x60
      <4>[  219.783606]  ? execlists_submission_tasklet+0x118/0x3a0 [i915]
      <4>[  219.783615]  tasklet_action_common.isra.14+0x13b/0x410
      <4>[  219.783623]  ? __do_softirq+0x1e4/0x9a7
      <4>[  219.783630]  __do_softirq+0x226/0x9a7
      <4>[  219.783643]  do_softirq_own_stack+0x2a/0x40
      <4>[  219.783647]  </IRQ>
      <4>[  219.783692]  ? heartbeat+0x3e2/0x10f0 [i915]
      <4>[  219.783696]  do_softirq.part.13+0x49/0x50
      <4>[  219.783700]  __local_bh_enable_ip+0x1a2/0x1e0
      <4>[  219.783748]  heartbeat+0x409/0x10f0 [i915]
      <4>[  219.783801]  ? __live_idle_pulse+0x9f0/0x9f0 [i915]
      <4>[  219.783806]  ? lock_acquire+0x1ac/0x8a0
      <4>[  219.783811]  ? process_one_work+0x811/0x1870
      <4>[  219.783827]  ? rcu_read_lock_sched_held+0x9c/0xd0
      <4>[  219.783832]  ? rcu_read_lock_bh_held+0xb0/0xb0
      <4>[  219.783836]  ? _raw_spin_unlock_irq+0x1f/0x40
      <4>[  219.783845]  process_one_work+0x8ca/0x1870
      <4>[  219.783848]  ? lock_acquire+0x1ac/0x8a0
      <4>[  219.783852]  ? worker_thread+0x1d0/0xb80
      <4>[  219.783864]  ? pwq_dec_nr_in_flight+0x2c0/0x2c0
      <4>[  219.783870]  ? do_raw_spin_lock+0x129/0x290
      <4>[  219.783886]  worker_thread+0x82/0xb80
      <4>[  219.783895]  ? __kthread_parkme+0xaf/0x1b0
      <4>[  219.783902]  ? process_one_work+0x1870/0x1870
      <4>[  219.783906]  kthread+0x34e/0x420
      <4>[  219.783911]  ? kthread_create_on_node+0xc0/0xc0
      <4>[  219.783918]  ret_from_fork+0x3a/0x50
      
      <3>[  219.783950] Allocated by task 1264:
      <4>[  219.783975]  save_stack+0x19/0x40
      <4>[  219.783978]  __kasan_kmalloc.constprop.3+0xa0/0xd0
      <4>[  219.784029]  i915_gem_create_context+0xa2/0xab8 [i915]
      <4>[  219.784081]  i915_gem_context_create_ioctl+0x1fa/0x450 [i915]
      <4>[  219.784085]  drm_ioctl_kernel+0x1d8/0x270
      <4>[  219.784088]  drm_ioctl+0x676/0x930
      <4>[  219.784092]  ksys_ioctl+0xb7/0xe0
      <4>[  219.784096]  __x64_sys_ioctl+0x6a/0xb0
      <4>[  219.784100]  do_syscall_64+0x94/0x530
      <4>[  219.784103]  entry_SYSCALL_64_after_hwframe+0x49/0xb3
      
      <3>[  219.784120] Freed by task 12:
      <4>[  219.784141]  save_stack+0x19/0x40
      <4>[  219.784145]  __kasan_slab_free+0x130/0x180
      <4>[  219.784148]  kmem_cache_free_bulk+0x1bd/0x500
      <4>[  219.784152]  kfree_rcu_work+0x1d8/0x890
      <4>[  219.784155]  process_one_work+0x8ca/0x1870
      <4>[  219.784158]  worker_thread+0x82/0xb80
      <4>[  219.784162]  kthread+0x34e/0x420
      <4>[  219.784165]  ret_from_fork+0x3a/0x50
      
      Fixes: 2e46a2a0
      
       ("drm/i915: Use explicit flag to mark unreachable intel_context")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Acked-by: default avatarAkeem G Abodunrin <akeem.g.abodunrin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200428090255.10035-1-chris@chris-wilson.co.uk
      (cherry picked from commit 24aac336
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      30523408
  2. Apr 29, 2020
  3. Apr 28, 2020
    • Chris Wilson's avatar
      drm/i915/gt: Check cacheline is valid before acquiring · 2abaad4e
      Chris Wilson authored
      The hwsp_cacheline pointer from i915_request is very, very flimsy. The
      i915_request.timeline (and the hwsp_cacheline) are lost upon retiring
      (after an RCU grace). Therefore we need to confirm that once we have the
      right pointer for the cacheline, it is not in the process of being
      retired and disposed of before we attempt to acquire a reference to the
      cacheline.
      
      <3>[  547.208237] BUG: KASAN: use-after-free in active_debug_hint+0x6a/0x70 [i915]
      <3>[  547.208366] Read of size 8 at addr ffff88822a0d2710 by task gem_exec_parall/2536
      
      <4>[  547.208547] CPU: 3 PID: 2536 Comm: gem_exec_parall Tainted: G     U            5.7.0-rc2-ged7a286b5d02d-kasan_117+ #1
      <4>[  547.208556] Hardware name: Dell Inc. XPS 13 9350/, BIOS 1.4.12 11/30/2016
      <4>[  547.208564] Call Trace:
      <4>[  547.208579]  dump_stack+0x96/0xdb
      <4>[  547.208707]  ? active_debug_hint+0x6a/0x70 [i915]
      <4>[  547.208719]  print_address_description.constprop.6+0x16/0x310
      <4>[  547.208841]  ? active_debug_hint+0x6a/0x70 [i915]
      <4>[  547.208963]  ? active_debug_hint+0x6a/0x70 [i915]
      <4>[  547.208975]  __kasan_report+0x137/0x190
      <4>[  547.209106]  ? active_debug_hint+0x6a/0x70 [i915]
      <4>[  547.209127]  kasan_report+0x32/0x50
      <4>[  547.209257]  ? i915_gemfs_fini+0x40/0x40 [i915]
      <4>[  547.209376]  active_debug_hint+0x6a/0x70 [i915]
      <4>[  547.209389]  debug_print_object+0xa7/0x220
      <4>[  547.209405]  ? lockdep_hardirqs_on+0x348/0x5f0
      <4>[  547.209426]  debug_object_assert_init+0x297/0x430
      <4>[  547.209449]  ? debug_object_free+0x360/0x360
      <4>[  547.209472]  ? lock_acquire+0x1ac/0x8a0
      <4>[  547.209592]  ? intel_timeline_read_hwsp+0x4f/0x840 [i915]
      <4>[  547.209737]  ? i915_active_acquire_if_busy+0x66/0x120 [i915]
      <4>[  547.209861]  i915_active_acquire_if_busy+0x66/0x120 [i915]
      <4>[  547.209990]  ? __live_alloc.isra.15+0xc0/0xc0 [i915]
      <4>[  547.210005]  ? rcu_read_lock_sched_held+0xd0/0xd0
      <4>[  547.210017]  ? print_usage_bug+0x580/0x580
      <4>[  547.210153]  intel_timeline_read_hwsp+0xbc/0x840 [i915]
      <4>[  547.210284]  __emit_semaphore_wait+0xd5/0x480 [i915]
      <4>[  547.210415]  ? i915_fence_get_timeline_name+0x110/0x110 [i915]
      <4>[  547.210428]  ? lockdep_hardirqs_on+0x348/0x5f0
      <4>[  547.210442]  ? _raw_spin_unlock_irq+0x2a/0x40
      <4>[  547.210567]  ? __await_execution.constprop.51+0x2e0/0x570 [i915]
      <4>[  547.210706]  i915_request_await_dma_fence+0x8f7/0xc70 [i915]
      
      Fixes: 85bedbf1
      
       ("drm/i915/gt: Eliminate the trylock for reading a timeline's hwsp")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: <stable@vger.kernel.org> # v5.6+
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200427093038.29219-1-chris@chris-wilson.co.uk
      (cherry picked from commit 2759e395
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      2abaad4e
    • Chris Wilson's avatar
      drm/i915/gem: Hold obj->vma.lock over for_each_ggtt_vma() · f524a774
      Chris Wilson authored
      
      
      While the ggtt vma are protected by their object lifetime, the list
      continues until it hits a non-ggtt vma, and that vma is not protected
      and may be freed as we inspect it. Hence, we require the obj->vma.lock
      to protect the list as we iterate.
      
      An example of forgetting to hold the obj->vma.lock is
      
      [1642834.464973] general protection fault, probably for non-canonical address 0xdead000000000122: 0000 [#1] SMP PTI
      [1642834.464977] CPU: 3 PID: 1954 Comm: Xorg Not tainted 5.6.0-300.fc32.x86_64 #1
      [1642834.464979] Hardware name: LENOVO 20ARS25701/20ARS25701, BIOS GJET94WW (2.44 ) 09/14/2017
      [1642834.465021] RIP: 0010:i915_gem_object_set_tiling+0x2c0/0x3e0 [i915]
      [1642834.465024] Code: 8b 84 24 18 01 00 00 f6 c4 80 74 59 49 8b 94 24 a0 00 00 00 49 8b 84 24 e0 00 00 00 49 8b 74 24 10 48 8b 92 30 01 00 00 89 c7 <80> ba 0a 06 00 00 03 0f 87 86 00 00 00 ba 00 00 08 00 b9 00 00 10
      [1642834.465025] RSP: 0018:ffffa98780c77d60 EFLAGS: 00010282
      [1642834.465028] RAX: ffff8d232bfb2578 RBX: 0000000000000002 RCX: ffff8d25873a0000
      [1642834.465029] RDX: dead000000000122 RSI: fffff0af8ac6e408 RDI: 000000002bfb2578
      [1642834.465030] RBP: ffff8d25873a0000 R08: ffff8d252bfb5638 R09: 0000000000000000
      [1642834.465031] R10: 0000000000000000 R11: ffff8d252bfb5640 R12: ffffa987801cb8f8
      [1642834.465032] R13: 0000000000001000 R14: ffff8d233e972e50 R15: ffff8d233e972d00
      [1642834.465034] FS:  00007f6a3d327f00(0000) GS:ffff8d25926c0000(0000) knlGS:0000000000000000
      [1642834.465036] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [1642834.465037] CR2: 00007f6a2064d000 CR3: 00000002fb57c001 CR4: 00000000001606e0
      [1642834.465038] Call Trace:
      [1642834.465083]  i915_gem_set_tiling_ioctl+0x122/0x230 [i915]
      [1642834.465121]  ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915]
      [1642834.465151]  drm_ioctl_kernel+0x86/0xd0 [drm]
      [1642834.465156]  ? avc_has_perm+0x3b/0x160
      [1642834.465178]  drm_ioctl+0x206/0x390 [drm]
      [1642834.465216]  ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915]
      [1642834.465221]  ? selinux_file_ioctl+0x122/0x1c0
      [1642834.465226]  ? __do_munmap+0x24b/0x4d0
      [1642834.465231]  ksys_ioctl+0x82/0xc0
      [1642834.465235]  __x64_sys_ioctl+0x16/0x20
      [1642834.465238]  do_syscall_64+0x5b/0xf0
      [1642834.465243]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [1642834.465245] RIP: 0033:0x7f6a3d7b047b
      [1642834.465247] Code: 0f 1e fa 48 8b 05 1d aa 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ed a9 0c 00 f7 d8 64 89 01 48
      [1642834.465249] RSP: 002b:00007ffe71adba28 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [1642834.465251] RAX: ffffffffffffffda RBX: 000055f99048fa40 RCX: 00007f6a3d7b047b
      [1642834.465253] RDX: 00007ffe71adba30 RSI: 00000000c0106461 RDI: 000000000000000e
      [1642834.465254] RBP: 0000000000000002 R08: 000055f98f3f1798 R09: 0000000000000002
      [1642834.465255] R10: 0000000000001000 R11: 0000000000000246 R12: 0000000000000080
      [1642834.465257] R13: 000055f98f3f1690 R14: 00000000c0106461 R15: 00007ffe71adba30
      
      Now to take the spinlock during the list iteration, we need to break it
      down into two phases. In the first phase under the lock, we cannot sleep
      and so must defer the actual work to a second list, protected by the
      ggtt->mutex.
      
      We also need to hold the spinlock during creation of a new vma to
      serialise with updates of the tiling on the object.
      
      Reported-by: default avatarDave Airlie <airlied@redhat.com>
      Fixes: 2850748e
      
       ("drm/i915: Pull i915_vma_pin under the vm->mutex")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: <stable@vger.kernel.org> # v5.5+
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200422072805.17340-1-chris@chris-wilson.co.uk
      (cherry picked from commit cb593e5d
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      f524a774
    • Xiyu Yang's avatar
      drm/i915/selftests: Fix i915_address_space refcnt leak · 5d5e100a
      Xiyu Yang authored
      igt_ppgtt_pin_update() invokes i915_gem_context_get_vm_rcu(), which
      returns a reference of the i915_address_space object to "vm" with
      increased refcount.
      
      When igt_ppgtt_pin_update() returns, "vm" becomes invalid, so the
      refcount should be decreased to keep refcount balanced.
      
      The reference counting issue happens in two exception handling paths of
      igt_ppgtt_pin_update(). When i915_gem_object_create_internal() returns
      IS_ERR, the refcnt increased by i915_gem_context_get_vm_rcu() is not
      decreased, causing a refcnt leak.
      
      Fix this issue by jumping to "out_vm" label when
      i915_gem_object_create_internal() returns IS_ERR.
      
      Fixes: a4e7ccda
      
       ("drm/i915: Move context management under GEM")
      Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/1587361342-83494-1-git-send-email-xiyuyang19@fudan.edu.cn
      (cherry picked from commit e07c7606
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      5d5e100a
  4. Apr 21, 2020
  5. Apr 14, 2020
  6. Apr 13, 2020
    • Linus Torvalds's avatar
      Linux 5.7-rc1 · 8f3d9f35
      Linus Torvalds authored
      v5.7-rc1
      8f3d9f35
    • Linus Torvalds's avatar
      MAINTAINERS: sort field names for all entries · 3b50142d
      Linus Torvalds authored
      
      
      This sorts the actual field names too, potentially causing even more
      chaos and confusion at merge time if you have edited the MAINTAINERS
      file.  But the end result is a more consistent layout, and hopefully
      it's a one-time pain minimized by doing this just before the -rc1
      release.
      
      This was entirely scripted:
      
        ./scripts/parse-maintainers.pl --input=MAINTAINERS --output=MAINTAINERS --order
      
      Requested-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3b50142d
    • Linus Torvalds's avatar
      MAINTAINERS: sort entries by entry name · 4400b7d6
      Linus Torvalds authored
      
      
      They are all supposed to be sorted, but people who add new entries don't
      always know the alphabet.  Plus sometimes the entry names get edited,
      and people don't then re-order the entry.
      
      Let's see how painful this will be for merging purposes (the MAINTAINERS
      file is often edited in various different trees), but Joe claims there's
      relatively few patches in -next that touch this, and doing it just
      before -rc1 is likely the best time.  Fingers crossed.
      
      This was scripted with
      
        /scripts/parse-maintainers.pl --input=MAINTAINERS --output=MAINTAINERS
      
      but then I also ended up manually upper-casing a few entry names that
      stood out when looking at the end result.
      
      Requested-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4400b7d6
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4f8a3cc1
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of three patches to fix the fallout of the newly added split
        lock detection feature.
      
        It addressed the case where a KVM guest triggers a split lock #AC and
        KVM reinjects it into the guest which is not prepared to handle it.
      
        Add proper sanity checks which prevent the unconditional injection
        into the guest and handles the #AC on the host side in the same way as
        user space detections are handled. Depending on the detection mode it
        either warns and disables detection for the task or kills the task if
        the mode is set to fatal"
      
      * tag 'x86-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        KVM: VMX: Extend VMXs #AC interceptor to handle split lock #AC in guest
        KVM: x86: Emulate split-lock access as a write in emulator
        x86/split_lock: Provide handle_guest_split_lock()
      4f8a3cc1
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0785249f
      Linus Torvalds authored
      Pull time(keeping) updates from Thomas Gleixner:
      
       - Fix the time_for_children symlink in /proc/$PID/ so it properly
         reflects that it part of the 'time' namespace
      
       - Add the missing userns limit for the allowed number of time
         namespaces, which was half defined but the actual array member was
         not added. This went unnoticed as the array has an exessive empty
         member at the end but introduced a user visible regression as the
         output was corrupted.
      
       - Prevent further silent ucount corruption by adding a BUILD_BUG_ON()
         to catch half updated data.
      
      * tag 'timers-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        ucount: Make sure ucounts in /proc/sys/user don't regress again
        time/namespace: Add max_time_namespaces ucount
        time/namespace: Fix time_for_children symlink
      0785249f
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 590680d1
      Linus Torvalds authored
      Pull scheduler fixes/updates from Thomas Gleixner:
      
       - Deduplicate the average computations in the scheduler core and the
         fair class code.
      
       - Fix a raise between runtime distribution and assignement which can
         cause exceeding the quota by up to 70%.
      
       - Prevent negative results in the imbalanace calculation
      
       - Remove a stale warning in the workqueue code which can be triggered
         since the call site was moved out of preempt disabled code. It's a
         false positive.
      
       - Deduplicate the print macros for procfs
      
       - Add the ucmap values to the SCHED_DEBUG procfs output for completness
      
      * tag 'sched-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/debug: Add task uclamp values to SCHED_DEBUG procfs
        sched/debug: Factor out printing formats into common macros
        sched/debug: Remove redundant macro define
        sched/core: Remove unused rq::last_load_update_tick
        workqueue: Remove the warning in wq_worker_sleeping()
        sched/fair: Fix negative imbalance in imbalance calculation
        sched/fair: Fix race between runtime distribution and assignment
        sched/fair: Align rq->avg_idle and rq->avg_scan_cost
      590680d1
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 20e2aa81
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "Three fixes/updates for perf:
      
         - Fix the perf event cgroup tracking which tries to track the cgroup
           even for disabled events.
      
         - Add Ice Lake server support for uncore events
      
         - Disable pagefaults when retrieving the physical address in the
           sampling code"
      
      * tag 'perf-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Disable page faults when getting phys address
        perf/x86/intel/uncore: Add Ice Lake server uncore support
        perf/cgroup: Correct indirection in perf_less_group_idx()
        perf/core: Fix event cgroup tracking
      20e2aa81
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 652fa53c
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "Three small fixes/updates for the locking core code:
      
         - Plug a task struct reference leak in the percpu rswem
           implementation.
      
         - Document the refcount interaction with PID_MAX_LIMIT
      
         - Improve the 'invalid wait context' data dump in lockdep so it
           contains all information which is required to decode the problem"
      
      * tag 'locking-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/lockdep: Improve 'invalid wait context' splat
        locking/refcount: Document interaction with PID_MAX_LIMIT
        locking/percpu-rwsem: Fix a task_struct refcount
      652fa53c
    • Linus Torvalds's avatar
      Merge tag '5.7-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · 4119bf9f
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Ten cifs/smb fixes:
      
         - five RDMA (smbdirect) related fixes
      
         - add experimental support for swap over SMB3 mounts
      
         - also a fix which improves performance of signed connections"
      
      * tag '5.7-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: enable swap on SMB3 mounts
        smb3: change noisy error message to FYI
        smb3: smbdirect support can be configured by default
        cifs: smbd: Do not schedule work to send immediate packet on every receive
        cifs: smbd: Properly process errors on ib_post_send
        cifs: Allocate crypto structures on the fly for calculating signatures of incoming packets
        cifs: smbd: Update receive credits before sending and deal with credits roll back on failure before sending
        cifs: smbd: Check send queue size before posting a send
        cifs: smbd: Merge code to track pending packets
        cifs: ignore cached share root handle closing errors
      4119bf9f
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.7-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 50bda5fa
      Linus Torvalds authored
      Pull NFS client bugfix from Trond Myklebust:
       "Fix an RCU read lock leakage in pnfs_alloc_ds_commits_list()"
      
      * tag 'nfs-for-5.7-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        pNFS: Fix RCU lock leakage
      50bda5fa
  7. Apr 12, 2020
    • Linus Torvalds's avatar
      Merge tag 'nios2-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 · b032227c
      Linus Torvalds authored
      Pull nios2 updates from Ley Foon Tan:
      
       - Remove nios2-dev@lists.rocketboards.org from MAINTAINERS
      
       - remove 'resetvalue' property
      
       - rename 'altr,gpio-bank-width' -> 'altr,ngpio'
      
       - enable the common clk subsystem on Nios2
      
      * tag 'nios2-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
        MAINTAINERS: Remove nios2-dev@lists.rocketboards.org
        arch: nios2: remove 'resetvalue' property
        arch: nios2: rename 'altr,gpio-bank-width' -> 'altr,ngpio'
        arch: nios2: Enable the common clk subsystem on Nios2
      b032227c
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.7-1' of git://git.infradead.org/users/hch/dma-mapping · 75e71883
      Linus Torvalds authored
      Pull dma-mapping fixes from Christoph Hellwig:
      
       - fix an integer truncation in dma_direct_get_required_mask
         (Kishon Vijay Abraham)
      
       - fix the display of dma mapping types (Grygorii Strashko)
      
      * tag 'dma-mapping-5.7-1' of git://git.infradead.org/users/hch/dma-mapping:
        dma-debug: fix displaying of dma allocation type
        dma-direct: fix data truncation in dma_direct_get_required_mask()
      75e71883
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · b753101a
      Linus Torvalds authored
      Pull more Kbuild updates from Masahiro Yamada:
      
       - raise minimum supported binutils version to 2.23
      
       - remove old CONFIG_AS_* macros that we know binutils >= 2.23 supports
      
       - move remaining CONFIG_AS_* tests to Kconfig from Makefile
      
       - enable -Wtautological-compare warnings to catch more issues
      
       - do not support GCC plugins for GCC <= 4.7
      
       - fix various breakages of 'make xconfig'
      
       - include the linker version used for linking the kernel into
         LINUX_COMPILER, which is used for the banner, and also exposed to
         /proc/version
      
       - link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y, which
         allows us to remove the lib-ksyms.o workaround, and to solve the last
         known issue of the LLVM linker
      
       - add dummy tools in scripts/dummy-tools/ to enable all compiler tests
         in Kconfig, which will be useful for distro maintainers
      
       - support the single switch, LLVM=1 to use Clang and all LLVM utilities
         instead of GCC and Binutils.
      
       - support LLVM_IAS=1 to enable the integrated assembler, which is still
         experimental
      
      * tag 'kbuild-v5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (36 commits)
        kbuild: fix comment about missing include guard detection
        kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
        kbuild: replace AS=clang with LLVM_IAS=1
        kbuild: add dummy toolchains to enable all cc-option etc. in Kconfig
        kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y
        MIPS: fw: arc: add __weak to prom_meminit and prom_free_prom_memory
        kbuild: remove -I$(srctree)/tools/include from scripts/Makefile
        kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h
        Documentation/llvm: fix the name of llvm-size
        kbuild: mkcompile_h: Include $LD version in /proc/version
        kconfig: qconf: Fix a few alignment issues
        kconfig: qconf: remove some old bogus TODOs
        kconfig: qconf: fix support for the split view mode
        kconfig: qconf: fix the content of the main widget
        kconfig: qconf: Change title for the item window
        kconfig: qconf: clean deprecated warnings
        gcc-plugins: drop support for GCC <= 4.7
        kbuild: Enable -Wtautological-compare
        x86: update AS_* macros to binutils >=2.23, supporting ADX and AVX2
        crypto: x86 - clean up poly1305-x86_64-cryptogams.S by 'make clean'
        ...
      b753101a
    • Sedat Dilek's avatar
      mailmap: Add Sedat Dilek (replacement for expired email address) · c7850ae4
      Sedat Dilek authored
      
      
      I do not longer work for credativ Germany.
      
      Please, use my private email address instead.
      
      This is for the case when people want to CC me on
      patches sent from my old business email address.
      
      Signed-off-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c7850ae4
  8. Apr 11, 2020
    • Trond Myklebust's avatar
      pNFS: Fix RCU lock leakage · 27d231c0
      Trond Myklebust authored
      Another brown paper bag moment. pnfs_alloc_ds_commits_list() is leaking
      the RCU lock.
      
      Fixes: a9901899
      
       ("pNFS: Add infrastructure for cleaning up per-layout commit structures")
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      27d231c0
    • Xiaoyao Li's avatar
      KVM: VMX: Extend VMXs #AC interceptor to handle split lock #AC in guest · e6f8b6c1
      Xiaoyao Li authored
      
      
      Two types of #AC can be generated in Intel CPUs:
       1. legacy alignment check #AC
       2. split lock #AC
      
      Reflect #AC back into the guest if the guest has legacy alignment checks
      enabled or if split lock detection is disabled.
      
      If the #AC is not a legacy one and split lock detection is enabled, then
      invoke handle_guest_split_lock() which will either warn and disable split
      lock detection for this task or force SIGBUS on it.
      
      [ tglx: Switch it to handle_guest_split_lock() and rename the misnamed
        helper function. ]
      
      Suggested-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Link: https://lkml.kernel.org/r/20200410115517.176308876@linutronix.de
      e6f8b6c1
    • Xiaoyao Li's avatar
      KVM: x86: Emulate split-lock access as a write in emulator · 9de6fe3c
      Xiaoyao Li authored
      
      
      Emulate split-lock accesses as writes if split lock detection is on
      to avoid #AC during emulation, which will result in a panic(). This
      should never occur for a well-behaved guest, but a malicious guest can
      manipulate the TLB to trigger emulation of a locked instruction[1].
      
      More discussion can be found at [2][3].
      
      [1] https://lkml.kernel.org/r/8c5b11c9-58df-38e7-a514-dc12d687b198@redhat.com
      [2] https://lkml.kernel.org/r/20200131200134.GD18946@linux.intel.com
      [3] https://lkml.kernel.org/r/20200227001117.GX9940@linux.intel.com
      
      Suggested-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Link: https://lkml.kernel.org/r/20200410115517.084300242@linutronix.de
      9de6fe3c
    • Thomas Gleixner's avatar
      x86/split_lock: Provide handle_guest_split_lock() · d7e94dbd
      Thomas Gleixner authored
      
      
      Without at least minimal handling for split lock detection induced #AC,
      VMX will just run into the same problem as the VMWare hypervisor, which
      was reported by Kenneth.
      
      It will inject the #AC blindly into the guest whether the guest is
      prepared or not.
      
      Provide a function for guest mode which acts depending on the host
      SLD mode. If mode == sld_warn, treat it like user space, i.e. emit a
      warning, disable SLD and mark the task accordingly. Otherwise force
      SIGBUS.
      
       [ bp: Add a !CPU_SUP_INTEL stub for handle_guest_split_lock(). ]
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Link: https://lkml.kernel.org/r/20200410115516.978037132@linutronix.de
      Link: https://lkml.kernel.org/r/20200402123258.895628824@linutronix.de
      d7e94dbd
    • Masahiro Yamada's avatar
      kbuild: fix comment about missing include guard detection · 00d76a0c
      Masahiro Yamada authored
      
      
      The keyword here is 'twice' to explain the trick.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      00d76a0c
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 5b8b9d0c
      Linus Torvalds authored
      Merge yet more updates from Andrew Morton:
      
       - Almost all of the rest of MM (memcg, slab-generic, slab, pagealloc,
         gup, hugetlb, pagemap, memremap)
      
       - Various other things (hfs, ocfs2, kmod, misc, seqfile)
      
      * akpm: (34 commits)
        ipc/util.c: sysvipc_find_ipc() should increase position index
        kernel/gcov/fs.c: gcov_seq_next() should increase position index
        fs/seq_file.c: seq_read(): add info message about buggy .next functions
        drivers/dma/tegra20-apb-dma.c: fix platform_get_irq.cocci warnings
        change email address for Pali Rohár
        selftests: kmod: test disabling module autoloading
        selftests: kmod: fix handling test numbers above 9
        docs: admin-guide: document the kernel.modprobe sysctl
        fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once()
        kmod: make request_module() return an error when autoloading is disabled
        mm/memremap: set caching mode for PCI P2PDMA memory to WC
        mm/memory_hotplug: add pgprot_t to mhp_params
        powerpc/mm: thread pgprot_t through create_section_mapping()
        x86/mm: introduce __set_memory_prot()
        x86/mm: thread pgprot_t through init_memory_mapping()
        mm/memory_hotplug: rename mhp_restrictions to mhp_params
        mm/memory_hotplug: drop the flags field from struct mhp_restrictions
        mm/special: create generic fallbacks for pte_special() and pte_mkspecial()
        mm/vma: introduce VM_ACCESS_FLAGS
        mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS
        ...
      5b8b9d0c
    • Linus Torvalds's avatar
      Merge tag 'docs-5.7-2' of git://git.lwn.net/linux · ca6151a9
      Linus Torvalds authored
      Pull Documentation fixes from Jonathan Corbet:
       "A handful of late-arriving fixes for the documentation tree"
      
      * tag 'docs-5.7-2' of git://git.lwn.net/linux:
        Documentation: android: binderfs: add 'stats' mount option
        Documentation: driver-api/usb/writing_usb_driver.rst Updates documentation links
        docs: driver-api: address duplicate label warning
        Documentation: sysrq: fix RST formatting
        docs: kernel-parameters.txt: Fix broken references
        docs: kernel-parameters.txt: Remove nompx
        docs: filesystems: fix typo in qnx6.rst
      ca6151a9
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.7-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux · 4e4bdcfa
      Linus Torvalds authored
      Pull orangefs updates from Mike Marshall:
       "A fix and two cleanups.
      
        Fix:
      
         - Christoph Hellwig noticed that some logic I added to
           orangefs_file_read_iter introduced a race condition, so he sent a
           reversion patch. I had to modify his patch since reverting at this
           point broke Orangefs.
      
        Cleanups:
      
         - Christoph Hellwig noticed that we were doing some unnecessary work
           in orangefs_flush, so he sent in a patch that removed the un-needed
           code.
      
         - Al Viro told me he had trouble building Orangefs. Orangefs should
           be easy to build, even for Al :-).
      
           I looked back at the test server build notes in orangefs.txt, just
           in case that's where the trouble really is, and found a couple of
           typos and made a couple of clarifications"
      
      * tag 'for-linus-5.7-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
        orangefs: clarify build steps for test server in orangefs.txt
        orangefs: don't mess with I_DIRTY_TIMES in orangefs_flush
        orangefs: get rid of knob code...
      4e4bdcfa
    • Linus Torvalds's avatar
      Merge tag 'xtensa-20200410' of git://github.com/jcmvbkbc/linux-xtensa · 9539303a
      Linus Torvalds authored
      Pull xtensa updates from Max Filippov:
      
       - replace setup_irq() by request_irq()
      
       - cosmetic fixes in xtensa Kconfig and boot/Makefile
      
      * tag 'xtensa-20200410' of git://github.com/jcmvbkbc/linux-xtensa:
        arch/xtensa: fix grammar in Kconfig help text
        xtensa: remove meaningless export ccflags-y
        xtensa: replace setup_irq() by request_irq()
      9539303a