提交 1d030f9f 编写于 作者: D Daniel Vetter 提交者: Zheng Zengkai

fbcon: Consistently protect deferred_takeover with console_lock()

stable inclusion
from stable-v5.10.121
commit 59dd1a07eecfde63cfdbacfca965292ad7d3601b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=59dd1a07eecfde63cfdbacfca965292ad7d3601b

--------------------------------

[ Upstream commit 43553559 ]

This shouldn't be a problem in practice since until we've actually
taken over the console there's nothing we've registered with the
console/vt subsystem, so the exit/unbind path that check this can't
do the wrong thing. But it's confusing, so fix it by moving it a tad
later.
Acked-by: NSam Ravnborg <sam@ravnborg.org>
Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Du Cheng <ducheng2@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Claudio Suarez <cssk@net-c.es>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-14-daniel.vetter@ffwll.chSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 e15db509
...@@ -3333,6 +3333,9 @@ static void fbcon_register_existing_fbs(struct work_struct *work) ...@@ -3333,6 +3333,9 @@ static void fbcon_register_existing_fbs(struct work_struct *work)
console_lock(); console_lock();
deferred_takeover = false;
logo_shown = FBCON_LOGO_DONTSHOW;
for_each_registered_fb(i) for_each_registered_fb(i)
fbcon_fb_registered(registered_fb[i]); fbcon_fb_registered(registered_fb[i]);
...@@ -3350,8 +3353,6 @@ static int fbcon_output_notifier(struct notifier_block *nb, ...@@ -3350,8 +3353,6 @@ static int fbcon_output_notifier(struct notifier_block *nb,
pr_info("fbcon: Taking over console\n"); pr_info("fbcon: Taking over console\n");
dummycon_unregister_output_notifier(&fbcon_output_nb); dummycon_unregister_output_notifier(&fbcon_output_nb);
deferred_takeover = false;
logo_shown = FBCON_LOGO_DONTSHOW;
/* We may get called in atomic context */ /* We may get called in atomic context */
schedule_work(&fbcon_deferred_takeover_work); schedule_work(&fbcon_deferred_takeover_work);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册