Add check for vc_cons[logo_shown].d, as it can be released by
vt_ioctl(VT_DISALLOCATE).
Reported-by: syzbot+732528bae351682f1f27@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <redacted>
---
drivers/video/fbdev/core/fbcon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Daniel Vetter <hidden> Date: 2020-03-28 16:31:49
On Sat, Mar 28, 2020 at 4:15 PM Qiujun Huang [off-list ref] wrote:
Add check for vc_cons[logo_shown].d, as it can be released by
vt_ioctl(VT_DISALLOCATE).
Can you pls link to the syzbot report and distill the essence of the
crash/issue here in the commit message? As-is a bit unclear what's
going on. Patch itself looks correct.
Thanks, Daniel
On Sun, Mar 29, 2020 at 12:31 AM Daniel Vetter [off-list ref] wrote:
On Sat, Mar 28, 2020 at 4:15 PM Qiujun Huang [off-list ref] wrote:
quoted
Add check for vc_cons[logo_shown].d, as it can be released by
vt_ioctl(VT_DISALLOCATE).
Can you pls link to the syzbot report and distill the essence of the
crash/issue here in the commit message? As-is a bit unclear what's
going on. Patch itself looks correct.
From: Sam Ravnborg <hidden> Date: 2020-03-28 18:13:07
Hi Qiujun
Thanks for looking into the sysbot bugs.
On Sat, Mar 28, 2020 at 11:15:10PM +0800, Qiujun Huang wrote:
quoted hunk
Add check for vc_cons[logo_shown].d, as it can be released by
vt_ioctl(VT_DISALLOCATE).
Reported-by: syzbot+732528bae351682f1f27@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <redacted>
---
drivers/video/fbdev/core/fbcon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
I am not familiar with this code.
But it looks like you try to avoid the sympton
which is that logo_shown has a wrong value after a
vc is deallocated, and do not fix the root cause.
We have:
vt_ioctl(VT_DISALLOCATE)
|
+- vc_deallocate()
|
+- visual_deinit()
|
+- vc->vc_sw->con_deinit(vc)
|
+- fbcon_deinit()
Would it be better to update logo_shown
in fbcon_deinit()?
Then we will not try to do anything with
the logo in fbcon_switch().
fbcon_deinit() is called with console locked
so there should not be any races.
I did not stare long enough on the code to come up with a patch,
but this may be a better way to fix it.
Sam
On Sun, Mar 29, 2020 at 2:13 AM Sam Ravnborg [off-list ref] wrote:
Hi Qiujun
Thanks for looking into the sysbot bugs.
On Sat, Mar 28, 2020 at 11:15:10PM +0800, Qiujun Huang wrote:
quoted
Add check for vc_cons[logo_shown].d, as it can be released by
vt_ioctl(VT_DISALLOCATE).
Reported-by: syzbot+732528bae351682f1f27@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <redacted>
---
drivers/video/fbdev/core/fbcon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
I am not familiar with this code.
But it looks like you try to avoid the sympton
which is that logo_shown has a wrong value after a
vc is deallocated, and do not fix the root cause.
We have:
vt_ioctl(VT_DISALLOCATE)
|
+- vc_deallocate()
|
+- visual_deinit()
|
+- vc->vc_sw->con_deinit(vc)
|
+- fbcon_deinit()
Would it be better to update logo_shown
in fbcon_deinit()?
Then we will not try to do anything with
the logo in fbcon_switch().
fbcon_deinit() is called with console locked
so there should not be any races.
Get that, thanks.
I did not stare long enough on the code to come up with a patch,
but this may be a better way to fix it.
Sam