linux-stable/drivers/gpu/drm
Chris Wilson dff01de1c3 drm: Unlink dead file_priv from list of active files first
In order to prevent external observers walking the list of open DRM
files from seeing an invalid drm_file_private in the process of being
torndown, the first operation we need to take is to unlink the
drm_file_private from that list.

	general protection fault: 0000 [#1] PREEMPT SMP
	Modules linked in: i915 i2c_algo_bit drm_kms_helper drm lpc_ich mfd_core nls_iso8859_1 i2c_hid video hid_generic usbhid hid e1000e ahci ptp libahci pps_core
	CPU: 3 PID: 8220 Comm: cat Not tainted 3.16.0-rc6+ #4
	Hardware name: Intel Corporation Shark Bay Client platform/WhiteTip Mountain 1, BIOS HSWLPTU1.86C.0119.R00.1303230105 03/23/2013
	task: ffff8800219642c0 ti: ffff880047024000 task.ti: ffff880047024000
	RIP: 0010:[<ffffffffa0137c70>]  [<ffffffffa0137c70>] per_file_stats+0x110/0x160 [i915]
	RSP: 0018:ffff880047027d48  EFLAGS: 00010246
	RAX: 6b6b6b6b6b6b6b6b RBX: ffff880047027e30 RCX: 0000000000000000
	RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff88003a05cd00
	RBP: ffff880047027d58 R08: 0000000000000001 R09: 0000000000000000
	R10: ffff8800219642c0 R11: 0000000000000000 R12: ffff88003a05cd00
	R13: 0000000000000000 R14: ffff88003a05cd00 R15: ffff880047027d88
	FS:  00007f5f73a13740(0000) GS:ffff88014e380000(0000) knlGS:0000000000000000
	CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
	CR2: 00000000023ff038 CR3: 0000000021a4b000 CR4: 00000000001407e0
	Stack:
	 0000000000000001 000000000000ffff ffff880047027dc8 ffffffff813438e4
	 ffff880047027e30 ffffffffa0137b60 ffff880021a8af58 ffff880021a8f1a0
	 ffff8800a2061fb0 ffff8800a2062048 ffff8800a2061fb0 ffff8800a1e23478
	Call Trace:
	 [<ffffffff813438e4>] idr_for_each+0xf4/0x180
	 [<ffffffffa0137b60>] ? i915_gem_stolen_list_info+0x1f0/0x1f0 [i915]
	 [<ffffffffa013a17a>] i915_gem_object_info+0x5ca/0x6a0 [i915]
	 [<ffffffff81193ec5>] seq_read+0xf5/0x3a0
	 [<ffffffff8116d950>] vfs_read+0x90/0x150
	 [<ffffffff8116e509>] SyS_read+0x49/0xb0
	 [<ffffffff815d8622>] tracesys+0xd0/0xd5
	Code: 01 00 00 49 39 84 24 08 01 00 00 74 55 49 8b 84 24 b8 00 00 00 48 01 43 18 31 c0 5b 41 5c 5d c3 0f 1f 00 49 8b 44 24 08 4c 89 e7 <48> 8b 70 28 48 81 c6 48 80 00 00 e8 80 14 01 00 84 c0 74 bc 49
	RIP  [<ffffffffa0137c70>] per_file_stats+0x110/0x160 [i915]
	RSP <ffff880047027d48>

Reported-by: "Ursulin, Tvrtko" <tvrtko.ursulin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81712
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "Ursulin, Tvrtko" <tvrtko.ursulin@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-05 11:05:49 +10:00
..
armada Merge branch 'drm-armada-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next 2014-07-23 13:01:56 +10:00
ast drm/ttm: Fix a few sparse warnings 2014-07-22 10:58:21 +10:00
bochs drm: bochs: fix warnings 2014-07-22 11:32:07 +10:00
bridge drm: add register and unregister functions for connectors 2014-06-19 08:55:28 +02:00
cirrus drm: cirrus: fix warnings 2014-07-22 11:32:04 +10:00
exynos drm/exynos: g2d: let exynos_g2d_get_ver_ioctl fail 2014-08-04 13:39:28 +09:00
gma500 drm: Introduce drm_fb_helper_prepare() 2014-07-08 11:31:28 +10:00
i2c drm/tda998x: update for new drm connector APIs. 2014-08-05 10:34:33 +10:00
i810 drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
i915 Linux 3.16 2014-08-05 09:04:59 +10:00
mga drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
mgag200 drm/ttm: Fix a few sparse warnings 2014-07-22 10:58:21 +10:00
msm drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo 2014-08-04 11:55:30 -04:00
nouveau Linux 3.16 2014-08-05 09:04:59 +10:00
omapdrm Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next 2014-07-29 20:49:36 +02:00
panel drm/panel: simple - Add AUO B133XTN01 panel support 2014-06-09 12:17:21 +02:00
qxl Linux 3.16 2014-08-05 09:04:59 +10:00
r128 drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
radeon Linux 3.16 2014-08-05 09:04:59 +10:00
rcar-du drm/rcar-du: Fix maximum frame buffer pitch computation 2014-07-30 11:08:24 +10:00
savage drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
shmobile drm: shmobile: fix warnings 2014-07-22 11:31:35 +10:00
sis drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
sti drm/sti: fix warning in build. 2014-08-05 09:41:42 +10:00
tdfx
tegra drm/tegra: Implement race-free hotplug detection 2014-07-08 11:31:36 +10:00
tilcdc drm/tilcdc: Fix build breakage 2014-07-10 12:01:38 +10:00
ttm drm/ttm: Pass GFP flags in order to avoid deadlock. 2014-08-05 10:54:19 +10:00
udl drm/udl: use helpers 2014-07-18 14:24:49 +10:00
via drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
vmwgfx drm/ttm: Fix a few sparse warnings 2014-07-22 10:58:21 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c drivers/gpu/drm/drm_buffer.c: remove unnecessary null test before kfree 2014-07-18 15:39:27 +02:00
drm_bufs.c drm: remove unused "struct drm_freelist" 2014-08-02 06:43:10 +10:00
drm_cache.c drm: Missed clflushopt in drm_clflush_virt_range 2014-06-02 09:57:31 +02:00
drm_context.c
drm_crtc.c Merge tag 'drm-intel-next-2014-07-25-merged' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-08-04 17:57:34 +10:00
drm_crtc_helper.c drm/crtc-helper: use drm_framebuffer flags 2014-07-08 11:18:47 +10:00
drm_crtc_internal.h
drm_debugfs.c drm/debugfs: add an "edid_override" file per connector 2014-06-19 08:56:28 +02:00
drm_dma.c
drm_dp_helper.c drm/dp: add a hw mutex around the transfer functions. (v2) 2014-06-05 09:54:29 +10:00
drm_dp_mst_topology.c drm/dp: Staticize a couple of DP utility functions 2014-07-22 10:58:28 +10:00
drm_drv.c drm: Add missing __user annotation 2014-07-22 10:57:20 +10:00
drm_edid.c Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next 2014-07-29 20:49:36 +02:00
drm_edid_load.c drm: replace drm_get_connector_name() with direct name field use 2014-06-04 13:17:41 +10:00
drm_encoder_slave.c
drm_fb_cma_helper.c drm: Introduce drm_fb_helper_prepare() 2014-07-08 11:31:28 +10:00
drm_fb_helper.c drm/fb_helper: allow adding/removing connectors later 2014-07-08 11:39:45 +10:00
drm_flip_work.c
drm_fops.c drm: Unlink dead file_priv from list of active files first 2014-08-05 11:05:49 +10:00
drm_gem.c drm/gem: remove misleading gfp parameter to get_pages() 2014-07-08 00:29:53 +02:00
drm_gem_cma_helper.c drm: gem_cma: Use ERR_CAST helper 2014-07-21 14:36:45 +10:00
drm_global.c
drm_hashtab.c
drm_info.c drm: remove unused "struct drm_freelist" 2014-08-02 06:43:10 +10:00
drm_ioc32.c
drm_ioctl.c drm: Remove command line guard for universal planes 2014-07-08 11:56:21 +10:00
drm_irq.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-06-12 11:32:30 -07:00
drm_lock.c
drm_memory.c
drm_mipi_dsi.c drm/dsi: Support device shutdown 2014-06-05 16:42:19 +02:00
drm_mm.c
drm_modes.c
drm_modeset_lock.c drm: fix uninitialized acquire_ctx fields (v2) 2014-06-19 10:30:36 +10:00
drm_of.c drm: add of_graph endpoint helper to find possible CRTCs 2014-07-11 15:38:28 +01:00
drm_panel.c
drm_pci.c drm: Add device registration documentation 2014-06-05 23:14:38 +02:00
drm_plane_helper.c drm/plane-helper: Use proper plane init function 2014-07-18 15:39:28 +02:00
drm_platform.c drm: Add device registration documentation 2014-06-05 23:14:38 +02:00
drm_prime.c
drm_probe_helper.c drm/debugfs: add an "edid_override" file per connector 2014-06-19 08:56:28 +02:00
drm_rect.c drm: Add drm_rect rotation functions 2014-07-11 23:44:12 +02:00
drm_scatter.c
drm_stub.c drm: Remove command line guard for universal planes 2014-07-08 11:56:21 +10:00
drm_sysfs.c drm: add register and unregister functions for connectors 2014-06-19 08:55:28 +02:00
drm_trace.h
drm_trace_points.c
drm_usb.c drm: Add device registration documentation 2014-06-05 23:14:38 +02:00
drm_vm.c
drm_vma_manager.c
Kconfig drm: sti: add VTG driver 2014-07-30 18:20:56 +02:00
Makefile drm: sti: add VTG driver 2014-07-30 18:20:56 +02:00
README.drm

************************************************************
* For the very latest on DRI development, please see:      *
*     http://dri.freedesktop.org/                          *
************************************************************

The Direct Rendering Manager (drm) is a device-independent kernel-level
device driver that provides support for the XFree86 Direct Rendering
Infrastructure (DRI).

The DRM supports the Direct Rendering Infrastructure (DRI) in four major
ways:

    1. The DRM provides synchronized access to the graphics hardware via
       the use of an optimized two-tiered lock.

    2. The DRM enforces the DRI security policy for access to the graphics
       hardware by only allowing authenticated X11 clients access to
       restricted regions of memory.

    3. The DRM provides a generic DMA engine, complete with multiple
       queues and the ability to detect the need for an OpenGL context
       switch.

    4. The DRM is extensible via the use of small device-specific modules
       that rely extensively on the API exported by the DRM module.


Documentation on the DRI is available from:
    http://dri.freedesktop.org/wiki/Documentation
    http://sourceforge.net/project/showfiles.php?group_id=387
    http://dri.sourceforge.net/doc/

For specific information about kernel-level support, see:

    The Direct Rendering Manager, Kernel Support for the Direct Rendering
    Infrastructure
    http://dri.sourceforge.net/doc/drm_low_level.html

    Hardware Locking for the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/hardware_locking_low_level.html

    A Security Analysis of the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/security_low_level.html