* [PATCH] fbcon: Initialize ops->info early @ 2017-11-13 9:45 ` Thierry Reding 2017-11-13 17:20 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 2+ messages in thread From: Thierry Reding @ 2017-11-13 9:45 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: linux-fbdev, linux-kernel, dri-devel, Kees Cook From: Thierry Reding <treding@nvidia.com> During console takeover, which happens for all DRM/KMS setups using the fbdev helpers, fbcon_startup() is called before fbcon_init() and as a result con2fb_acquire_newinfo() will not be called (info->fbcon_par was set to non-NULL in fbcon_startup()) to assign ops->info. This causes the cursor_timer_handler() to unreference a NULL pointer. Avoid this by unconditionally assigning ops->info during fbcon_startup() so that it will be available early, but keep the additional assignment in con2fb_acquire_newinfo() to support console remapping at runtime. Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com> --- drivers/video/fbdev/core/fbcon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 3b4a96379128..929ca472c524 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -962,6 +962,7 @@ static const char *fbcon_startup(void) ops->graphics = 1; ops->cur_rotate = -1; ops->cur_blink_jiffies = HZ / 5; + ops->info = info; info->fbcon_par = ops; if (initial_rotation != -1) p->con_rotate = initial_rotation; -- 2.14.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fbcon: Initialize ops->info early 2017-11-13 9:45 ` [PATCH] fbcon: Initialize ops->info early Thierry Reding @ 2017-11-13 17:20 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 2+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2017-11-13 17:20 UTC (permalink / raw) To: Thierry Reding; +Cc: linux-fbdev, linux-kernel, dri-devel, Kees Cook On Monday, November 13, 2017 10:45:46 AM Thierry Reding wrote: > From: Thierry Reding <treding@nvidia.com> > > During console takeover, which happens for all DRM/KMS setups using the > fbdev helpers, fbcon_startup() is called before fbcon_init() and as a > result con2fb_acquire_newinfo() will not be called (info->fbcon_par was > set to non-NULL in fbcon_startup()) to assign ops->info. > > This causes the cursor_timer_handler() to unreference a NULL pointer. > > Avoid this by unconditionally assigning ops->info during fbcon_startup() > so that it will be available early, but keep the additional assignment > in con2fb_acquire_newinfo() to support console remapping at runtime. > > Cc: Kees Cook <keescook@chromium.org> > Signed-off-by: Thierry Reding <treding@nvidia.com> Patch queued for 4.15, thanks. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-13 17:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20171113094554epcas3p2eb67a3b7263176dfabc719e3bddb792c@epcas3p2.samsung.com>
2017-11-13 9:45 ` [PATCH] fbcon: Initialize ops->info early Thierry Reding
2017-11-13 17:20 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).