public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm: Kernel Crash in drm_unlock
@ 2015-03-31  8:09 Peter Antoine
  2015-03-31  8:09 ` [PATCH] drm: Possible lock priority escalation Peter Antoine
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Peter Antoine @ 2015-03-31  8:09 UTC (permalink / raw)
  To: intel-gfx

This patch fixes a possible kernel crash when drm_unlock (DRM_IOCTL_UNLOCK)
is called by a application that has not had a lock created by it. This
crash can be caused by any application from all users.

Issue: GMINL-7446
Change-Id: I901ff713be53c5ec1c9eaf7ee0ff4314a659af05
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
---
 drivers/gpu/drm/drm_lock.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index f645268..80253a7 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -156,6 +156,14 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
 		return -EINVAL;
 	}
 
+	if (!master->lock.hw_lock) {
+		DRM_ERROR(
+			"Device has been unregistered. Hard exit. Process %d\n",
+			task_pid_nr(current));
+		send_sig(SIGTERM, current, 0);
+		return -EINTR;
+	}
+
 	if (drm_lock_free(&master->lock, lock->context)) {
 		/* FIXME: Should really bail out here. */
 	}
-- 
1.9.1

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-04-16  7:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-31  8:09 [PATCH] drm: Kernel Crash in drm_unlock Peter Antoine
2015-03-31  8:09 ` [PATCH] drm: Possible lock priority escalation Peter Antoine
2015-03-31 15:53   ` shuang.he
2015-03-31  8:09 ` [PATCH] drm: Fixes unsafe deference in locks Peter Antoine
2015-03-31 18:20   ` shuang.he
2015-03-31 13:24 ` [PATCH] drm: Kernel Crash in drm_unlock shuang.he
2015-03-31 13:25 ` Daniel Vetter
2015-03-31 13:28   ` Damien Lespiau
2015-03-31 13:34   ` Antoine, Peter
2015-03-31 14:00     ` Daniel Vetter
2015-03-31 14:21       ` Antoine, Peter
2015-04-15 14:22       ` Antoine, Peter
2015-04-16  7:30         ` Daniel Vetter
2015-03-31 13:35   ` Damien Lespiau
2015-03-31 13:38     ` Antoine, Peter
2015-03-31 13:44       ` Damien Lespiau
2015-03-31 13:47         ` Antoine, Peter
2015-03-31 13:53         ` He, Shuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox