public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm: Prevent NULL deref in drm_name_info()
@ 2016-06-20 18:53 Chris Wilson
  2016-06-22 11:14 ` Eric Engestrom
  2016-06-22 12:32 ` ✗ Ro.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2016-06-20 18:53 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

If a driver does not have a parent, or never sets the unique name for
itself, then we may proceed to chase a NULL dereference through
debugfs/.../name.

Testcase: igt/vgem_basic/debugfs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_info.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index 0090d5987801..e2d2543d5bd0 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -51,17 +51,16 @@ int drm_name_info(struct seq_file *m, void *data)
 	struct drm_minor *minor = node->minor;
 	struct drm_device *dev = minor->dev;
 	struct drm_master *master = minor->master;
-	if (!master)
-		return 0;
-
-	if (master->unique) {
-		seq_printf(m, "%s %s %s\n",
-			   dev->driver->name,
-			   dev_name(dev->dev), master->unique);
-	} else {
-		seq_printf(m, "%s %s\n",
-			   dev->driver->name, dev_name(dev->dev));
-	}
+
+	seq_printf(m, "%s", dev->driver->name);
+	if (dev->dev)
+		seq_printf(m, " dev=%s", dev_name(dev->dev));
+	if (master && master->unique)
+		seq_printf(m, " master=%s", master->unique);
+	if (dev->unique)
+		seq_printf(m, " unique=%s", dev->unique);
+	seq_printf(m, "\n");
+
 	return 0;
 }
 
-- 
2.8.1

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

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

* Re: [PATCH] drm: Prevent NULL deref in drm_name_info()
  2016-06-20 18:53 [PATCH] drm: Prevent NULL deref in drm_name_info() Chris Wilson
@ 2016-06-22 11:14 ` Eric Engestrom
  2016-06-22 12:32 ` ✗ Ro.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Engestrom @ 2016-06-22 11:14 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Mon, Jun 20, 2016 at 07:53:33PM +0100, Chris Wilson wrote:
> If a driver does not have a parent, or never sets the unique name for
> itself, then we may proceed to chase a NULL dereference through
> debugfs/.../name.
> 
> Testcase: igt/vgem_basic/debugfs
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Ro.CI.BAT: failure for drm: Prevent NULL deref in drm_name_info()
  2016-06-20 18:53 [PATCH] drm: Prevent NULL deref in drm_name_info() Chris Wilson
  2016-06-22 11:14 ` Eric Engestrom
@ 2016-06-22 12:32 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-06-22 12:32 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm: Prevent NULL deref in drm_name_info()
URL   : https://patchwork.freedesktop.org/series/8944/
State : failure

== Summary ==

Applying: drm: Prevent NULL deref in drm_name_info()
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/drm_info.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/drm_info.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/drm_info.c
error: Failed to merge in the changes.
Patch failed at 0001 drm: Prevent NULL deref in drm_name_info()
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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

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

end of thread, other threads:[~2016-06-22 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-20 18:53 [PATCH] drm: Prevent NULL deref in drm_name_info() Chris Wilson
2016-06-22 11:14 ` Eric Engestrom
2016-06-22 12:32 ` ✗ Ro.CI.BAT: failure for " Patchwork

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