From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: daniel.vetter@ffwll.ch, david@lechnology.com,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/fb-helper: Avoid NULL ptr dereference in fb_set_suspend()
Date: Thu, 31 Aug 2017 12:30:56 +0300 [thread overview]
Message-ID: <5553486.INJTWRbyCC@avalon> (raw)
In-Reply-To: <20170828213457.3qbfi7wyhbapn44x@phenom.ffwll.local>
Hello,
On Tuesday, 29 August 2017 00:34:57 EEST Daniel Vetter wrote:
> On Mon, Aug 28, 2017 at 07:17:43PM +0200, Noralf Trønnes wrote:
> > drm_fb_helper_resume_worker() uses fb_helper->fbdev to call
> > fb_set_suspend() which dereferences the pointer.
> > Move sync-canceling of the resume worker in drm_fb_helper_fini() before
> > setting fb_helper->fbdev to NULL.
> >
> > Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> > ---
> >
> > drivers/gpu/drm/drm_fb_helper.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_fb_helper.c
> > b/drivers/gpu/drm/drm_fb_helper.c index 1b8f013..2e33467 100644
> > --- a/drivers/gpu/drm/drm_fb_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > @@ -910,6 +910,8 @@ void drm_fb_helper_fini(struct drm_fb_helper
> > *fb_helper)>
> > if (!drm_fbdev_emulation || !fb_helper)
> >
> > return;
> >
> > + cancel_work_sync(&fb_helper->resume_work);
> > +
> >
> > info = fb_helper->fbdev;
> > if (info) {
> >
> > if (info->cmap.len)
> >
> > @@ -918,7 +920,6 @@ void drm_fb_helper_fini(struct drm_fb_helper
> > *fb_helper)>
> > }
> > fb_helper->fbdev = NULL;
> >
> > - cancel_work_sync(&fb_helper->resume_work);
> >
> > cancel_work_sync(&fb_helper->dirty_work);
>
> Hm, I would have moved both up, just for safety. Either way:
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I was going to mention the same, let's move both. With this changed,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > mutex_lock(&kernel_fb_helper_lock);
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-08-31 9:30 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-28 17:17 [PATCH 0/6] drm/tinydrm: Support device unplug Noralf Trønnes
2017-08-28 17:17 ` [PATCH 1/6] drm/fb-helper: Avoid NULL ptr dereference in fb_set_suspend() Noralf Trønnes
2017-08-28 21:34 ` Daniel Vetter
2017-08-31 9:30 ` Laurent Pinchart [this message]
2017-09-02 12:46 ` Noralf Trønnes
2017-08-28 17:17 ` [PATCH 2/6] drm/fb-helper: Support device unplug Noralf Trønnes
2017-08-28 21:41 ` Daniel Vetter
2017-08-29 16:17 ` Noralf Trønnes
2017-08-30 7:29 ` Daniel Vetter
2017-08-30 13:45 ` Noralf Trønnes
2017-08-28 17:17 ` [PATCH 3/6] drm/fb-cma-helper: " Noralf Trønnes
2017-08-28 21:46 ` Daniel Vetter
2017-08-29 17:23 ` Noralf Trønnes
2017-08-30 7:36 ` Daniel Vetter
2017-08-28 17:17 ` [PATCH 4/6] drm/tinydrm: Embed drm_device in tinydrm_device Noralf Trønnes
2017-08-28 21:47 ` Daniel Vetter
2017-08-29 19:09 ` David Lechner
2017-08-31 10:18 ` Laurent Pinchart
2017-08-31 17:16 ` Noralf Trønnes
2017-09-01 7:28 ` Laurent Pinchart
2017-09-01 18:46 ` Noralf Trønnes
2017-08-28 17:17 ` [PATCH 5/6] drm/tinydrm/mi0283qt: Let the display pipe handle power Noralf Trønnes
2017-08-28 17:17 ` [PATCH 6/6] drm/tinydrm: Support device unplug Noralf Trønnes
2017-08-28 21:56 ` Daniel Vetter
2017-08-30 16:31 ` Noralf Trønnes
2017-08-30 17:18 ` Daniel Vetter
2017-08-31 12:59 ` Laurent Pinchart
2017-08-31 19:22 ` Noralf Trønnes
2017-09-01 8:38 ` Laurent Pinchart
2017-09-02 20:59 ` Noralf Trønnes
2017-09-04 7:26 ` Daniel Vetter
2017-09-04 8:41 ` Laurent Pinchart
2017-09-04 9:04 ` Daniel Vetter
2017-09-04 9:38 ` Laurent Pinchart
2017-09-04 12:30 ` Noralf Trønnes
2017-09-04 15:20 ` Daniel Vetter
2017-09-04 15:54 ` Noralf Trønnes
2017-09-04 16:39 ` Daniel Vetter
2017-08-28 21:58 ` [PATCH 0/6] " Daniel Vetter
2017-08-29 18:05 ` Noralf Trønnes
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=5553486.INJTWRbyCC@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=david@lechnology.com \
--cc=dri-devel@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox