linux-brain/drivers/gpu/drm/i915
Matthew Brost c5c2b4ca50 drm/i915: Fix syncmap memory leak
[ Upstream commit a63bcf08f0efb5348105bb8e0e1e8c6671077753 ]

A small race exists between intel_gt_retire_requests_timeout and
intel_timeline_exit which could result in the syncmap not getting
free'd. Rather than work to hard to seal this race, simply cleanup the
syncmap on fini.

unreferenced object 0xffff88813bc53b18 (size 96):
  comm "gem_close_race", pid 5410, jiffies 4294917818 (age 1105.600s)
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 00  ................
    00 00 00 00 00 00 00 00 6b 6b 6b 6b 06 00 00 00  ........kkkk....
  backtrace:
    [<00000000120b863a>] __sync_alloc_leaf+0x1e/0x40 [i915]
    [<00000000042f6959>] __sync_set+0x1bb/0x240 [i915]
    [<0000000090f0e90f>] i915_request_await_dma_fence+0x1c7/0x400 [i915]
    [<0000000056a48219>] i915_request_await_object+0x222/0x360 [i915]
    [<00000000aaac4ee3>] i915_gem_do_execbuffer+0x1bd0/0x2250 [i915]
    [<000000003c9d830f>] i915_gem_execbuffer2_ioctl+0x405/0xce0 [i915]
    [<00000000fd7a8e68>] drm_ioctl_kernel+0xb0/0xf0 [drm]
    [<00000000e721ee87>] drm_ioctl+0x305/0x3c0 [drm]
    [<000000008b0d8986>] __x64_sys_ioctl+0x71/0xb0
    [<0000000076c362a4>] do_syscall_64+0x33/0x80
    [<00000000eb7a4831>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Fixes: 531958f6f3 ("drm/i915/gt: Track timeline activeness in enter/exit")
Cc: <stable@vger.kernel.org>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210730195342.110234-1-matthew.brost@intel.com
(cherry picked from commit faf890985e30d5e88cc3a7c50c1bcad32f89ab7c)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-03 10:08:14 +02:00
..
display i915: fix build warning in intel_dp_get_link_status() 2021-06-03 08:59:16 +02:00
gem drm/i915: Avoid div-by-zero on gen2 2021-05-19 10:08:29 +02:00
gt drm/i915: Fix syncmap memory leak 2021-09-03 10:08:14 +02:00
gvt drm/i915/gvt: Fix error code in intel_gvt_init_device() 2021-05-14 09:44:29 +02:00
oa drm/i915/perf: Refactor oa object to better manage resources 2019-08-07 20:34:39 +01:00
selftests drm/i915: Add missing include file <linux/math64.h> 2020-01-23 08:22:38 +01:00
Kconfig drm/i915: Update drm/i915 bug filing URL 2020-02-28 17:22:21 +01:00
Kconfig.debug kbuild: remove header compile test 2020-03-05 16:43:47 +01:00
Kconfig.profile
Makefile Kbuild updates for v5.4 2019-09-20 08:36:47 -07:00
i915_active.c drm/i915: Fix ref->mutex deadlock in i915_active_wait() 2020-04-13 10:48:15 +02:00
i915_active.h drm/i915: Fix ref->mutex deadlock in i915_active_wait() 2020-04-13 10:48:15 +02:00
i915_active_types.h drm/i915: Markup expected timeline locks for i915_active 2019-08-16 18:02:07 +01:00
i915_buddy.c drm/i915/buddy: use kmemleak_update_trace 2019-08-16 16:28:41 +01:00
i915_buddy.h drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_cmd_parser.c drm/i915: Fix cmd parser desc matching with masks 2020-09-03 11:27:09 +02:00
i915_debugfs.c drm/i915: Pull obj->userfault tracking under the ggtt->mutex 2019-08-22 08:53:41 +01:00
i915_debugfs.h
i915_drv.c drm fixes for 5.4-rc8 2019-11-15 08:47:34 -08:00
i915_drv.h drm/i915: Check for all subplatform bits 2021-02-03 23:25:58 +01:00
i915_fixed.h drm/i915: make i915_fixed.h self-contained 2019-06-27 10:50:24 +03:00
i915_gem.c drm/i915: Wean off drm_pci_alloc/drm_pci_free 2020-02-28 17:22:21 +01:00
i915_gem.h drm/i915/gt: execlists->active is serialised by the tasklet 2019-10-09 14:39:31 -07:00
i915_gem_evict.c drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
i915_gem_fence_reg.c drm/i915: Replace i915_vma_put_fence() 2019-08-22 08:53:42 +01:00
i915_gem_fence_reg.h drm/i915: Track ggtt fence reservations under its own mutex 2019-08-22 08:53:40 +01:00
i915_gem_gtt.c drm/i915/userptr: fix size calculation 2020-01-29 16:45:31 +01:00
i915_gem_gtt.h drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
i915_getparam.c drm/i915: Disable Secure Batches for gen6+ 2019-11-05 11:34:08 -08:00
i915_globals.c drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_globals.h drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_gpu_error.c drm/i915: Break up error capture compression loops with cond_resched() 2020-11-10 12:37:23 +01:00
i915_gpu_error.h drm/i915: Only include active engines in the capture state 2019-08-08 21:54:08 +01:00
i915_ioc32.c
i915_irq.c drm/i915/icl+: Fix hotplug interrupt disabling after storm detection 2020-06-24 17:50:51 +02:00
i915_irq.h drm/i915: Extract general GT interrupt handlers 2019-08-12 15:36:13 +01:00
i915_memcpy.c drm/i915: extract i915_memcpy.h from i915_drv.h 2019-08-09 12:03:25 +03:00
i915_memcpy.h drm/i915: extract i915_memcpy.h from i915_drv.h 2019-08-09 12:03:25 +03:00
i915_mm.c drm/i915: Drop expectations of VM_IO from our GGTT mmappings 2019-08-07 12:06:07 +01:00
i915_params.c Revert "drm/i915: Update description of i915.enable_guc modparam" 2019-07-19 15:36:21 +01:00
i915_params.h Revert "drm/i915/guc: Turn on GuC/HuC auto mode" 2019-07-19 15:35:58 +01:00
i915_pci.c drm/i915/gtt: disable 2M pages for pre-gen11 2019-08-10 13:19:00 +01:00
i915_perf.c drm/i915: extract i915_perf.h from i915_drv.h 2019-08-09 11:52:04 +03:00
i915_perf.h drm/i915: extract i915_perf.h from i915_drv.h 2019-08-09 11:52:04 +03:00
i915_pmu.c drm/i915/pmu: "Frequency" is reported as accumulated cycles 2019-11-18 09:20:38 -08:00
i915_pmu.h
i915_priolist_types.h drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
i915_pvinfo.h drm/i915: make i915_pvinfo.h self-contained 2019-06-27 10:50:35 +03:00
i915_query.c drm/i915/gt: Move the [class][inst] lookup for engines onto the GT 2019-08-06 15:00:43 +01:00
i915_query.h
i915_reg.h drm/i915: Add Wa_1407352427:icl,ehl 2020-01-14 20:08:26 +01:00
i915_request.c drm/i915: Propagate error from completed fences 2020-05-27 17:46:43 +02:00
i915_request.h drm/i915: Defer semaphore priority bumping to a workqueue 2020-03-18 07:17:50 +01:00
i915_scatterlist.c
i915_scatterlist.h
i915_scheduler.c drm/i915/gt: Protect defer_request() from new waiters 2020-02-28 17:22:25 +01:00
i915_scheduler.h
i915_scheduler_types.h drm/i915/execlists: Minimalistic timeslicing 2019-06-20 16:52:36 +01:00
i915_selftest.h drm/i915: make i915_selftest.h self-contained 2019-07-30 13:41:35 -07:00
i915_suspend.c drm/i915: extract i915_suspend.h from i915_drv.h 2019-08-09 12:03:05 +03:00
i915_suspend.h drm/i915: extract i915_suspend.h from i915_drv.h 2019-08-09 12:03:05 +03:00
i915_sw_fence.c drm/i915: Filter wake_flags passed to default_wake_function 2020-09-23 12:40:43 +02:00
i915_sw_fence.h Merge drm/drm-next into drm-intel-next-queued 2019-08-22 00:10:36 -07:00
i915_sw_fence_work.c drm/i915: Generalise the clflush dma-worker 2019-08-22 08:27:44 +01:00
i915_sw_fence_work.h drm/i915: Generalise the clflush dma-worker 2019-08-22 08:27:44 +01:00
i915_syncmap.c
i915_syncmap.h
i915_sysfs.c drm/i915: extract i915_sysfs.h from i915_drv.h 2019-08-09 11:52:09 +03:00
i915_sysfs.h drm/i915: extract i915_sysfs.h from i915_drv.h 2019-08-09 11:52:09 +03:00
i915_trace.h drm/i915: rename intel_drv.h to display/intel_display_types.h 2019-08-07 12:43:50 +03:00
i915_trace_points.c
i915_user_extensions.c
i915_user_extensions.h
i915_utils.c drm/i915: Update drm/i915 bug filing URL 2020-02-28 17:22:21 +01:00
i915_utils.h drm/i915: be more solid in checking the alignment 2020-03-18 07:17:50 +01:00
i915_vgpu.c drm/i915: to make vgpu ppgtt notificaiton as atomic operation 2019-09-06 09:53:12 -07:00
i915_vgpu.h drm/i915: make i915_vgpu.h self-contained 2019-06-27 10:50:38 +03:00
i915_vma.c drm/i915: Replace i915_vma_put_fence() 2019-08-22 08:53:42 +01:00
i915_vma.h drm/i915: Replace i915_vma_put_fence() 2019-08-22 08:53:42 +01:00
intel_csr.c drm/i915/tgl: update DMC firmware to 2.04 2019-08-20 12:49:29 -07:00
intel_csr.h
intel_device_info.c drm/i915/tgl: add support for reading the timestamp frequency 2019-08-20 12:48:57 -07:00
intel_device_info.h drm/i915/tgl: Tigerlake only has global MOCS registers 2019-07-31 07:40:32 -07:00
intel_gvt.c drm/i915: Add i915 to i915_inject_probe_failure 2019-08-02 21:14:29 +01:00
intel_gvt.h drm/i915: Propagate "_remove" function name suffix down 2019-07-12 13:05:08 +01:00
intel_pch.c drm/i915/cml: Add second PCH ID for CMP 2019-10-09 13:00:56 -07:00
intel_pch.h drm/i915/cml: Add second PCH ID for CMP 2019-10-09 13:00:56 -07:00
intel_pm.c Fix misc new gcc warnings 2021-05-11 14:04:16 +02:00
intel_pm.h drm/i915/gen8+: Add RC6 CTX corruption WA 2019-11-05 11:43:07 -08:00
intel_runtime_pm.c drm/i915: avoid including intel_drv.h via i915_drv.h->i915_trace.h 2019-08-07 12:43:14 +03:00
intel_runtime_pm.h Merge drm/drm-next into drm-intel-next-queued 2019-07-29 08:51:48 -07:00
intel_sideband.c drm/i915: remove unnecessary includes of intel_display_types.h header 2019-08-07 12:43:55 +03:00
intel_sideband.h
intel_uncore.c drm/i915: Drop runtime-pm assert from vgpu io accessors 2020-11-10 12:37:23 +01:00
intel_uncore.h drm/i915: split out uncore_mmio_debug 2019-08-09 20:25:24 +01:00
intel_wakeref.c drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
intel_wakeref.h drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
intel_wopcm.c drm/i915/wopcm: Fix SPDX tag location 2019-08-16 16:50:03 +01:00
intel_wopcm.h drm/i915/wopcm: Don't fail on WOPCM partitioning failure 2019-08-02 21:14:32 +01:00