linux_dsm_epyc7002/drivers/gpu/drm
Chris Wilson 2759e39535 drm/i915/gt: Check cacheline is valid before acquiring
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: 85bedbf191 ("drm/i915/gt: Eliminate the trylock for reading a timeline's hwsp")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <stable@vger.kernel.org> # v5.6+
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200427093038.29219-1-chris@chris-wilson.co.uk
2020-04-27 11:39:23 +01:00
..
amd Topic pull request for topic/phy-compliance: 2020-04-16 14:52:59 +03:00
arc drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
arm drm/komeda: mark PM functions as __maybe_unused 2020-03-06 11:25:58 +08:00
armada drm: Remove drm_fb_helper add, add all and remove connector calls 2020-03-06 14:19:58 +01:00
aspeed
ast drm/ast: Use simple encoder 2020-03-02 09:22:43 +01:00
atmel-hlcdc drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
bochs Linux 5.6 2020-03-31 15:15:47 +10:00
bridge drm/bridge: analogix_dp: Split bind() into probe() and real bind() 2020-04-09 10:29:35 +02:00
cirrus drm/cirrus: add drm_driver.release callback. 2020-02-12 10:24:08 +01:00
etnaviv drm/etnaviv: fix TS cache flushing on GPUs with BLT engine 2020-03-20 18:40:44 +01:00
exynos drm/bridge: analogix_dp: Split bind() into probe() and real bind() 2020-04-09 10:29:35 +02:00
fsl-dcu drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
gma500 drm: Remove drm_fb_helper add, add all and remove connector calls 2020-03-06 14:19:58 +01:00
hisilicon Linux 5.6-rc5 2020-03-11 07:27:21 +10:00
i2c drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
i810
i915 drm/i915/gt: Check cacheline is valid before acquiring 2020-04-27 11:39:23 +01:00
imx drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
ingenic drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
lib
lima drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
mcde drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
mediatek sound updates for 5.7-rc1 2020-04-02 15:50:04 -07:00
meson drm/meson: Add YUV420 output support 2020-03-10 10:51:24 +01:00
mga
mgag200 drm/mgag200: Use simple encoder 2020-03-02 09:22:49 +01:00
msm IOMMU Updates for Linux v5.7 2020-04-08 11:00:00 -07:00
mxsfb
nouveau drm fixes for 5.7-rc1 2020-04-07 20:24:34 -07:00
omapdrm ARM: driver updates 2020-04-03 15:05:35 -07:00
panel drm/panel-simple: drop use of data-mapping property 2020-03-25 21:59:22 +01:00
panfrost drm-misc-next for 5.7: 2020-03-12 12:42:56 +10:00
pl111 drm/pl111: Support Integrator IM-PD1 module 2020-02-16 14:31:30 +01:00
qxl drm/qxl: Use simple encoder 2020-03-02 09:22:56 +01:00
r128
radeon pci-v5.7-changes 2020-04-03 14:25:02 -07:00
rcar-du drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
rockchip drm/bridge: analogix_dp: Split bind() into probe() and real bind() 2020-04-09 10:29:35 +02:00
savage
scheduler drm/scheduler: fix rare NULL ptr race 2020-03-26 10:22:36 -04:00
selftests drm/modes: Make sure to parse valid rotation value from cmdline 2020-02-12 18:32:54 +01:00
shmobile
sis
sti drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
stm drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
sun4i Linux 5.6-rc5 2020-03-11 07:27:21 +10:00
tdfx
tegra drm/tegra: Changes for v5.7-rc1 2020-03-19 10:11:09 +10:00
tidss drm/tidss: Drop pointless static qualifier in dispc_find_csc() 2020-02-28 14:48:58 +02:00
tilcdc drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
tiny drm/tiny: fix sparse warning: incorrect type in assignment (different base types) 2020-03-14 08:31:30 +01:00
ttm drm fixes for 5.7-rc1 (part two) 2020-04-10 12:38:28 -07:00
tve200
udl drm/udl: Clear struct drm_connector_funcs.dpms 2020-02-10 09:24:09 +01:00
v3d drm/v3d: Replace wait_for macros to remove use of msleep 2020-03-04 22:15:34 -08:00
vboxvideo drm/vboxvideo: Add missing remove_conflicting_pci_framebuffers call, v2 2020-03-26 17:03:03 +01:00
vc4 drm/vc4: Fix HDMI mode validation 2020-03-27 13:38:47 +01:00
vgem drm/vgem: Close use-after-free race in vgem_gem_create 2020-02-06 19:04:41 +01:00
via Merge branch 'akpm' (patches from Andrew) 2020-01-31 12:16:36 -08:00
virtio drm/virtio: fix OOB in virtio_gpu_object_create 2020-04-06 15:10:37 +02:00
vkms drm/vkms: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:10 +01:00
vmwgfx Merge branch 'ttm-transhuge' of git://people.freedesktop.org/~thomash/linux into drm-next 2020-04-03 09:07:49 +10:00
xen drm/xen: fix passing zero to 'PTR_ERR' warning 2020-03-31 17:14:51 +02:00
zte drm/zte: plane_state->fb iff plane_state->crtc 2020-01-28 15:43:58 +01:00
drm_agpsupport.c
drm_atomic_helper.c drm/bridge: Add the necessary bits to support bus format negotiation 2020-01-31 16:39:53 +01:00
drm_atomic_state_helper.c drm/atomic-helper: fix kerneldoc 2020-02-15 13:21:22 +01:00
drm_atomic_uapi.c
drm_atomic.c drm/bridge: Fix the bridge kernel doc 2020-02-18 16:50:45 +01:00
drm_auth.c drm/auth: Drop master_create/destroy hooks 2020-01-29 09:14:11 +01:00
drm_blend.c
drm_bridge_connector.c drm: Add helper to create a connector for a chain of bridges 2020-02-26 13:31:41 +02:00
drm_bridge.c drm: Add helper to create a connector for a chain of bridges 2020-02-26 13:31:41 +02:00
drm_bufs.c drm: bufs: Clean up documentation 2020-03-16 09:26:18 +01:00
drm_cache.c
drm_client_modeset.c Linux 5.6-rc5 2020-03-11 07:27:21 +10:00
drm_client.c drm/client: Dual licence the file in GPL-2 and MIT 2020-02-29 00:16:12 +01:00
drm_color_mgmt.c
drm_connector.c drm/connector: Add helper to get a connector type name 2020-02-26 13:31:18 +02:00
drm_context.c drm: context: Clean up documentation 2020-03-16 09:23:55 +01:00
drm_crtc_helper_internal.h
drm_crtc_helper.c drm: drop unused drm_crtc callback 2020-02-15 21:15:17 +01:00
drm_crtc_internal.h
drm_crtc.c
drm_damage_helper.c
drm_debugfs_crc.c drm/crc: Actually allow to change the crc source 2020-01-28 16:49:22 +01:00
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c Topic pull request for topic/phy-compliance: 2020-04-16 14:52:59 +03:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c Linux 5.6 2020-03-31 15:15:47 +10:00
drm_drv.c drm: Nerf drm_global_mutex BKL for good drivers 2020-02-11 15:03:09 +01:00
drm_dsc.c
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm/edid: Distribute switch variables for initialization 2020-03-16 10:54:08 +01:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c drm: Remove unused arg from drm_fb_helper_init 2020-03-06 14:19:57 +01:00
drm_file.c drm/vmwgfx: Hook up the helpers to align buffer objects 2020-03-24 18:50:35 +01:00
drm_flip_work.c
drm_format_helper.c drm/format_helper: Dual licence the file in GPL 2 and MIT 2020-02-17 10:27:13 +01:00
drm_fourcc.c
drm_framebuffer.c
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/shmem: drop pgprot_decrypted() 2020-03-02 07:13:19 +01:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c drm/vram: Add helpers to validate a display mode's memory requirements 2020-02-06 10:32:54 +01:00
drm_gem.c drm: Mark up racy check of drm_gem_object.handle_count 2020-03-16 10:31:35 +00:00
drm_hashtab.c
drm_hdcp.c drm/hdcp: optimizing the srm handling 2020-03-04 06:33:00 +05:30
drm_internal.h drm/hdcp: optimizing the srm handling 2020-03-04 06:33:00 +05:30
drm_ioc32.c
drm_ioctl.c
drm_irq.c drm/irq: remove check on dev->dev_private 2020-02-11 18:39:47 +02:00
drm_kms_helper_common.c
drm_lease.c drm/lease: fix WARNING in idr_destroy 2020-03-18 14:42:18 +01:00
drm_legacy_misc.c
drm_legacy.h
drm_lock.c drm: lock: Clean up documentation 2020-03-16 09:27:09 +01:00
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: Remove sending of vblank event 2020-01-30 09:00:45 +01:00
drm_mipi_dsi.c
drm_mm.c drm/mm: revert "Break long searches in fragmented address spaces" 2020-03-31 17:35:56 +02:00
drm_mode_config.c
drm_mode_object.c
drm_modes.c drm/modes: Make sure to parse valid rotation value from cmdline 2020-02-12 18:32:54 +01:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel_orientation_quirks.c
drm_panel.c
drm_pci.c drm: Make drm_pci_agp_init legacy 2020-03-09 09:22:50 +00:00
drm_plane_helper.c
drm_plane.c
drm_prime.c drm/prime: fix extracting of the DMA addresses from a scatterlist 2020-04-05 10:44:12 -04:00
drm_print.c
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_scatter.c drm: prevent a harmless integer overflow in drm_legacy_sg_alloc() 2020-02-29 00:16:12 +01:00
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/simple-kms: Fix documentation for drm_simple_encoder_init() 2020-03-06 09:24:29 +01:00
drm_syncobj.c
drm_sysfs.c drm: sysfs: Use scnprintf() for avoiding potential buffer overflow 2020-03-11 14:54:09 +01:00
drm_trace_points.c
drm_trace.h
drm_vblank.c drm/vblank: Fix documentation of VBLANK timestamp helper 2020-03-06 09:24:54 +01:00
drm_vm.c drm: vm: Clean up documentation 2020-03-16 09:25:22 +01:00
drm_vma_manager.c
drm_vram_helper_common.c
drm_writeback.c
Kconfig drm: unbreak the DRM menu, broken by DRM_EXPORT_FOR_TESTS 2020-03-06 11:15:43 +00:00
Makefile drm: Add helper to create a connector for a chain of bridges 2020-02-26 13:31:41 +02:00