From: Daniel Vetter <daniel@ffwll.ch>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: sean@poorly.run, dri-devel@lists.freedesktop.org,
airlied@redhat.com, sam@ravnborg.org
Subject: Re: [PATCH 1/5] drm/udl: Clear BO vmapping pointer after unmapping BO memory
Date: Fri, 25 Oct 2019 09:39:15 +0200 [thread overview]
Message-ID: <20191025073915.GP11828@phenom.ffwll.local> (raw)
In-Reply-To: <20191024144237.8898-2-tzimmermann@suse.de>
On Thu, Oct 24, 2019 at 04:42:33PM +0200, Thomas Zimmermann wrote:
> 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>
Hm right now this is not a problem, becase we remove the vmapping only
when we free the underlying object. If that changes somehow, then what we
actually need is to start refcount the vmapping (and drop the trick in
udl_handle_damage and unconditionally vmap/vunmap). Might be easier to
just cut over to shmem helpers.
-Daniel
> ---
> 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
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-10-25 7:39 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 ` [PATCH 1/5] drm/udl: Clear BO vmapping pointer after unmapping BO memory Thomas Zimmermann
2019-10-25 7:39 ` Daniel Vetter [this message]
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=20191025073915.GP11828@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
--cc=tzimmermann@suse.de \
/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.