All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@redhat.com, sean@poorly.run, daniel@ffwll.ch,
	sam@ravnborg.org, noralf@tronnes.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: [PATCH 1/5] drm/udl: Clear BO vmapping pointer after unmapping BO memory
Date: Thu, 24 Oct 2019 16:42:33 +0200	[thread overview]
Message-ID: <20191024144237.8898-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20191024144237.8898-1-tzimmermann@suse.de>

Unmapping the BO memory with udl_gem_vunmap() creates a dangling pointer
in struct udl_gem_object.vmapping. This can crash udl_handle_damage(),
which check the pointer's value for NULL. Clear the pointer to NULL and
let udl_handle_damage() re-establish the mapping if necessary.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/udl/udl_gem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
index b23a5c2fcd80..3ea0cd9ae2d6 100644
--- a/drivers/gpu/drm/udl/udl_gem.c
+++ b/drivers/gpu/drm/udl/udl_gem.c
@@ -174,6 +174,7 @@ void udl_gem_vunmap(struct udl_gem_object *obj)
 	}
 
 	vunmap(obj->vmapping);
+	obj->vmapping = NULL;
 
 	udl_gem_put_pages(obj);
 }
-- 
2.23.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-10-24 14:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 14:42 [PATCH 0/5] drm/udl: Convert to generic fbdev emulation Thomas Zimmermann
2019-10-24 14:42 ` Thomas Zimmermann [this message]
2019-10-25  7:39   ` [PATCH 1/5] drm/udl: Clear BO vmapping pointer after unmapping BO memory Daniel Vetter
2019-10-24 14:42 ` [PATCH 2/5] drm/udl: Set drm_driver.gem_prime_mmap Thomas Zimmermann
2019-10-24 14:42 ` [PATCH 3/5] drm/udl: Add GEM object functions for free(), vmap(), and vunmap() Thomas Zimmermann
2019-10-25  7:40   ` Daniel Vetter
2019-10-25  7:59     ` Thomas Zimmermann
2019-10-25  7:59       ` Thomas Zimmermann
2019-10-25  9:28       ` Daniel Vetter
2019-10-25  9:28         ` Daniel Vetter
2019-10-25 10:12         ` Thomas Zimmermann
2019-10-25 10:12           ` Thomas Zimmermann
2019-10-25 11:44           ` Noralf Trønnes
2019-10-25 11:44             ` Noralf Trønnes
2019-10-25 11:47             ` Noralf Trønnes
2019-10-25 11:47               ` Noralf Trønnes
2019-10-25 12:20             ` Thomas Zimmermann
2019-10-25 12:20               ` Thomas Zimmermann
2019-10-25 13:32               ` Gerd Hoffmann
2019-10-25 14:53                 ` Thomas Zimmermann
2019-10-25 14:53                   ` Thomas Zimmermann
2019-10-25 13:44               ` Noralf Trønnes
2019-10-25 13:44                 ` Noralf Trønnes
2019-10-24 14:42 ` [PATCH 4/5] drm/udl: Map BO memory pages in unencrypted mode Thomas Zimmermann
2019-10-24 14:42 ` [PATCH 5/5] drm/udl: Replace fbdev code with generic emulation Thomas Zimmermann
2019-10-25  7:47   ` Daniel Vetter
2019-10-25  8:00     ` Daniel Vetter
2019-10-25 11:22       ` Noralf Trønnes
2019-10-25 11:44         ` Thomas Zimmermann
2019-10-25  8:08     ` Thomas Zimmermann
2019-10-25 19:10       ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191024144237.8898-2-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=noralf@tronnes.org \
    --cc=sam@ravnborg.org \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.