linux_dsm_epyc7002/drivers/gpu/drm
Chris Wilson 367a35a6c6 drm/i915: Don't deref request->ctx inside unlocked print_request()
Although we protect the request itself, we don't lock inside
intel_engine_dump() and so the request maybe retired as we peek into it.
One consequence is that the request->ctx may be freed before we
dereference it, leading to a use-after-free. Replace the hw_id we are
peeking from inside request->ctx with the request->fence.context, with
which we can still track from which context the request originated
(although to tie to HW reports requires a little more legwork, but is
good enough to follow the GEM traces).

[52640.729670] general protection fault: 0000 [#2] SMP
[52640.729694] Dumping ftrace buffer:
[52640.729701]    (ftrace buffer empty)
[52640.729705] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic x86_pkg_\
temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul snd_hda_intel snd_hda_codec snd_hwdep gha\
sh_clmulni_intel snd_hda_core snd_pcm mei_me mei i915 r8169 mii prime_numbers i2c_hid
[52640.729748] CPU: 2 PID: 4335 Comm: gem_exec_schedu Tainted: G     UD W        4.16.0-rc3+ #7
[52640.729759] Hardware name: Acer Aspire E5-575G/Ironman_SK  , BIOS V1.12 08/02/2016
[52640.729803] RIP: 0010:print_request+0x2b/0xb0 [i915]
[52640.729811] RSP: 0018:ffffc90001453c18 EFLAGS: 00010206
[52640.729820] RAX: 6b6b6b6b6b6b6b6b RBX: ffff8801e0292d40 RCX: 0000000000000006
[52640.729829] RDX: ffffc90001453c60 RSI: ffff8801e0292d40 RDI: 0000000000000003
[52640.729838] RBP: ffffc90001453d80 R08: 0000000000000000 R09: 0000000000000001
[52640.729847] R10: ffffc90001453bd0 R11: ffffc90001453c73 R12: ffffc90001453c60
[52640.729856] R13: ffffc90001453d80 R14: ffff8801d5a683c8 R15: ffff8801e0292d40
[52640.729866] FS:  00007f1ee50548c0(0000) GS:ffff8801e8200000(0000) knlGS:0000000000000000
[52640.729876] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[52640.729884] CR2: 00007f1ee5077000 CR3: 00000001d9411004 CR4: 00000000003606e0
[52640.729893] Call Trace:
[52640.729922]  intel_engine_print_registers+0x623/0x890 [i915]
[52640.729948]  intel_engine_dump+0x4a3/0x590 [i915]
[52640.729957]  ? seq_printf+0x3a/0x50
[52640.729977]  i915_engine_info+0xb8/0xe0 [i915]
[52640.729984]  ? drm_mode_gamma_get_ioctl+0xf0/0xf0
[52640.729990]  seq_read+0xd5/0x410
[52640.729997]  full_proxy_read+0x4b/0x70
[52640.730004]  __vfs_read+0x1e/0x120
[52640.730009]  ? do_sys_open+0x134/0x220
[52640.730015]  ? kmem_cache_free+0x174/0x2b0
[52640.730021]  vfs_read+0xa1/0x150
[52640.730026]  SyS_read+0x40/0xa0
[52640.730032]  do_syscall_64+0x65/0x1a0
[52640.730038]  entry_SYSCALL_64_after_hwframe+0x42/0xb7

Reported-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180228094732.28462-1-chris@chris-wilson.co.uk
2018-02-28 14:16:42 +00:00
..
amd drm/amdgpu: Handle 64-bit return from drm_crtc_vblank_count() 2018-02-15 11:49:35 -08:00
arc drm/arc: Use drm_gem_cma_print_info() 2017-11-11 11:23:15 +01:00
arm drm/arm/mali: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:43 +01:00
armada Merge branch 'drm-armada-devel-4.15' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next 2018-01-05 09:51:43 +10:00
ast drm/ast: Load lut in crtc_commit 2018-02-01 11:35:46 +10:00
atmel-hlcdc drm/atmel-hlcdc: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:39 +01:00
bochs drm/bochs: remove the default io_mem_pfn set 2017-12-27 11:34:51 -05:00
bridge Linux 4.15-rc4 2017-12-19 21:37:24 +10:00
cirrus drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2) 2017-12-28 09:48:19 -05:00
etnaviv drm/etnaviv: use memset32 to init pagetable 2018-01-02 17:36:53 +01:00
exynos drm/exynos: ipp: Remove Exynos DRM IPP subsystem 2018-01-02 08:41:22 +09:00
fsl-dcu drm/fsl-dcu: Use drm_mode_config_helper_suspend/resume() 2017-12-05 13:46:41 +01:00
gma500 drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:05:22 +01:00
hisilicon drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2) 2017-12-28 09:48:19 -05:00
i2c Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
i810
i915 drm/i915: Don't deref request->ctx inside unlocked print_request() 2018-02-28 14:16:42 +00:00
imx drm/imx: format modifier support 2018-01-05 11:33:24 +10:00
lib License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mediatek Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
meson drm/meson: Add missing VPU init 2017-12-08 10:43:46 +01:00
mga Merge airlied/drm-next into drm-misc-next 2017-07-26 13:43:33 +02:00
mgag200 drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2) 2017-12-28 09:48:19 -05:00
msm Merge tag 'drm-msm-next-2018-01-10' of git://people.freedesktop.org/~robclark/linux into drm-next 2018-01-12 11:45:18 +10:00
mxsfb drm/mxsfb: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb() 2017-10-01 17:02:20 +02:00
nouveau drm/nouveau/clk: fix gcc-7 -Wint-in-bool-context warning 2018-02-02 15:24:10 +10:00
omapdrm Linux 4.15-rc8 2018-01-18 09:32:15 +10:00
panel drm/panel: lvds: Handle the optional regulator case properly 2018-01-15 10:16:56 +01:00
pl111 drm/pl111: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:41 +01:00
qxl drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2) 2017-12-28 09:48:19 -05:00
r128 r128: switch compat ioctls to drm_ioctl_kernel() 2017-09-29 13:42:35 -04:00
radeon drm/radeon: Handle 64-bit return from drm_crtc_vblank_count() 2018-02-15 11:49:42 -08:00
rcar-du drm: rcar-du: Clip planes to screen boundaries 2017-12-04 18:38:31 +02:00
rockchip drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:08:06 +01:00
savage
scheduler drm/scheduler: add license to the Makefile 2017-12-07 11:52:29 -05:00
selftests Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
shmobile main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
sis
sti drm/sti: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:41 +01:00
stm drm/stm: ltdc: Remove unnecessary platform_get_resource() error check 2017-12-19 15:23:45 +01:00
sun4i Fixes for 4.16: 2018-01-25 11:42:25 +10:00
tdfx
tegra drm/tegra: Handle 64-bit return from drm_crtc_vblank_count() 2018-02-15 11:49:49 -08:00
tilcdc drm/tilcdc changes for 4.16 2017-12-21 11:10:20 +10:00
tinydrm drm/tinydrm: add driver for ST7735R panels 2018-01-03 13:54:24 +01:00
ttm Merge branch 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux into drm-next 2018-01-25 11:40:54 +10:00
tve200 drm/tve200: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:42 +01:00
udl Merge tag 'drm-misc-next-2017-10-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-10-24 16:51:05 +10:00
vc4 Linux 4.15-rc8 2018-01-18 09:32:15 +10:00
vgem treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
via Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
virtio drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2) 2017-12-28 09:48:19 -05:00
vmwgfx Linux 4.15-rc8 2018-01-18 09:32:15 +10:00
zte drm/zte: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:43 +01:00
ati_pcigart.c
drm_agpsupport.c drm/agpsupport: Remove extra blank line 2017-09-20 09:54:19 -07:00
drm_atomic_helper.c Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
drm_atomic.c drm/atomic: document how to handle driver private objects 2017-12-15 11:26:54 +01:00
drm_auth.c drm: Check for lessee in DROP_MASTER ioctl 2018-01-31 09:27:51 +01:00
drm_blend.c drm/atomic-helper: Make zpos property kerneldoc less misleading 2017-12-14 14:20:35 +01:00
drm_bridge.c drm/bridge: change return type of drm_bridge_add function 2017-08-21 08:51:53 +05:30
drm_bufs.c
drm_cache.c
drm_color_mgmt.c drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_connector.c Linux 4.15-rc4 2017-12-19 21:37:24 +10:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c drm: Replace kzalloc with kcalloc 2017-10-13 15:49:03 -04:00
drm_crtc_internal.h drm: rework delayed connector cleanup in connector_iter 2017-12-13 22:59:00 +01:00
drm_crtc.c drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_debugfs_crc.c drm/atomic: Prepare drm_modeset_lock infrastructure for interruptible waiting, v2. 2017-09-13 09:50:52 +02:00
drm_debugfs.c drm/debugfs: Fix framebuffer debugfs file init 2017-11-14 11:08:17 +02:00
drm_dma.c
drm_dp_aux_dev.c Pass mode to wait_on_atomic_t() action funcs and provide default actions 2017-11-13 15:38:16 +00:00
drm_dp_dual_mode_helper.c drm: Add retries for lspcon mode detection 2017-10-13 12:13:54 +03:00
drm_dp_helper.c drm: don't link DP aux i2c adapter to the hardware device node 2017-11-20 09:34:17 +01:00
drm_dp_mst_topology.c drm/dp/mst: Sideband message transaction to power up/down nodes 2017-09-11 16:03:57 +03:00
drm_drv.c Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
drm_dumb_buffers.c drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy 2017-07-29 13:51:44 +02:00
drm_edid_load.c drm: add backwards compatibility support for drm_kms_helper.edid_firmware 2017-09-19 18:11:45 +03:00
drm_edid.c drm/edid: kerneldoc for is_hdmi2_sink 2017-12-15 11:13:15 +01:00
drm_encoder_slave.c
drm_encoder.c drm: Check mode object lease status in all master ioctl paths [v4] 2017-10-25 16:31:30 +10:00
drm_fb_cma_helper.c drm/cma-helper: Add drm_fb_cma_fbdev_init/fini() 2017-12-08 14:27:47 +01:00
drm_fb_helper.c drm/framebuffer: Print task that allocated the fb in debug info. 2017-12-20 15:30:17 +01:00
drm_file.c drm: Document device unplug infrastructure 2017-08-11 10:48:03 +02:00
drm_flip_work.c
drm_fourcc.c
drm_framebuffer.c drm/framebuffer: Print task that allocated the fb in debug info. 2017-12-20 15:30:17 +01:00
drm_gem_cma_helper.c drm: gem_cma_helper.c: Allow importing of contiguous scatterlists with nents > 1 2017-11-15 18:14:46 +01:00
drm_gem_framebuffer_helper.c drm/gem-fb-helper: drm_gem_fbdev_fb_create() make funcs optional 2017-12-08 14:26:00 +01:00
drm_gem.c drm/framebuffer: Add framebuffer debugfs file 2017-11-11 11:21:19 +01:00
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
drm_ioc32.c Merge airlied/drm-next into drm-misc-next 2017-07-26 13:43:33 +02:00
drm_ioctl.c drm: Add four ioctls for managing drm mode object leases [v7] 2017-10-25 16:31:30 +10:00
drm_irq.c
drm_kms_helper_common.c drm: add backwards compatibility support for drm_kms_helper.edid_firmware 2017-09-19 18:11:45 +03:00
drm_lease.c drm: move lease init after validation in drm_lease_create 2017-12-21 09:49:40 +01:00
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c drm: Convert to using %pOF instead of full_name 2017-07-26 13:45:06 +02:00
drm_mm.c Linux 4.15-rc4 2017-12-19 21:37:24 +10:00
drm_mode_config.c Linux 4.15-rc4 2017-12-19 21:37:24 +10:00
drm_mode_object.c drm/mode_object: fix documentation for object lookups. 2017-11-10 13:50:47 +10:00
drm_modes.c drm/modes: Fix drm_mode_is_420_only() comment 2017-07-31 14:23:30 +02:00
drm_modeset_helper.c drm/modeset-helper: Add simple modeset suspend/resume helpers 2017-11-30 18:18:08 +01:00
drm_modeset_lock.c drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all 2017-10-31 17:36:46 +01:00
drm_of.c drm/drm_of: Move drm_of_panel_bridge_remove_function into header. 2017-10-13 16:59:36 +02:00
drm_panel_orientation_quirks.c drm: fix tainted kernel caused by drm_panel_orientation_quirks.c 2017-12-23 20:06:45 +01:00
drm_panel.c
drm_pci.c drm/core: clean up references to drm_dev_unref() 2017-09-27 10:53:12 +02:00
drm_plane_helper.c drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c 2017-11-20 21:14:22 +02:00
drm_plane.c drm/atomic: Handle 64-bit return from drm_crtc_vblank_count() 2018-02-15 11:49:57 -08:00
drm_prime.c drm/prime: skip CPU sync in map/unmap dma_buf 2017-12-04 17:30:19 +01:00
drm_print.c drm/printer: Add drm_vprintf() 2017-11-23 12:31:49 +02:00
drm_probe_helper.c drm/probe-helper: Fix drm_kms_helper_poll_enable() docs 2017-11-30 18:17:37 +01:00
drm_property.c drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_rect.c
drm_scatter.c
drm_scdc_helper.c Merge tag 'drm-misc-next-2017-09-20' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-09-28 05:46:15 +10:00
drm_simple_kms_helper.c drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c 2017-11-20 21:14:22 +02:00
drm_syncobj.c Linux 4.15-rc8 2018-01-18 09:32:15 +10:00
drm_sysfs.c
drm_trace_points.c
drm_trace.h main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
drm_vblank.c drm/doc: Fix documentation for _vblank_restore(). 2018-02-21 19:29:06 +01:00
drm_vm.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-09-04 12:21:28 -07:00
drm_vma_manager.c drm/drm_vma_manager.c: Remove useless goto statement 2017-11-02 10:44:08 +01:00
Kconfig Fixes for 4.16: 2018-01-25 11:42:25 +10:00
Makefile drm: fix gpu scheduler link order 2018-01-24 15:49:04 -05:00