[PATCH] drm: Prevent early NULL dereference of fb_helper->fb

Chris Wilson chris at chris-wilson.co.uk
Thu Jul 20 08:52:49 UTC 2017


Quoting Daniel Vetter (2017-07-20 09:26:32)
> On Wed, Jul 19, 2017 at 04:24:50PM +0100, Chris Wilson wrote:
> > Prior to the fbdev being asynchronously configured on boot, the
> > fb_helper->fb may be unset.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101767
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Thierry Reding <treding at nvidia.com>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > ---
> > This may not be necessary with the recent async rework? One hopes.
> 
> It shouldn't be possible to call into check_var (or any other fb_ops
> callback) before we register the framebuffer, and we don't do that before
> the fb is real.
> 
> The bug description also says that after several suspend/resume cycles
> does it blow up like that, so very unlikely fbdev isn't set up yet. And
> the NULL pointer isn't really NULL.
> 
> There's something going wrong for sure, but I don't think it's this.

It was a stab in the dark as it looked like fb was the pointer behind
the crash. (And I have an inherent distrust of this code running before
everything is setup, and we know from experience that we can suspend
before it is setup.) We can rule out *var, so use-after-free of fb?
-Chris


More information about the dri-devel mailing list