Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2165819iof; Tue, 7 Jun 2022 21:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO8Q8p3nfdhwEq3Eao+i6JEx/PQi31Zh7qxrXwDMmod7zic84COmd3SpMvGl3OfUbwnH5h X-Received: by 2002:a65:52cd:0:b0:3f5:f3fb:6780 with SMTP id z13-20020a6552cd000000b003f5f3fb6780mr29028417pgp.150.1654664189664; Tue, 07 Jun 2022 21:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664189; cv=none; d=google.com; s=arc-20160816; b=zQp2C5OCE8Sc5V++nG3L89oyxww/xNtRsYmcJa0kAq++fEg2/ORWq158D9vp/58+j5 FgGhnO4iIMc7En73+WzsvYXyDIe9HEo+vJAtxJYoYbJbKZyqV4uyEtNrLCmA52pzm5ek +mWmVJZQEHYSGlNAVjW5xvJGjBIz9rRd24MXAETYuEu4a4+80XxqmoWkNYtZMZOf2q/G k8cTmdqjAa85v33JbOsKhhFzG7e9tzrIznzI+A8rn020SMt/fbrKwr6tgkyQdMF8v9Nd pnpCgg57run2PykBVh1us9W908x2C6WyBhEtOXbuDu296AoAH1+29HnbS9Ae9Wur4Gok lmcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mozRLZwtVTWzfPRPo5/lHITzuAmLyZw/tirQHVep6L8=; b=IcYJUaJg4xSXTRMtla5eTtbtLrHKxFJ5ue30PAKOUsAb/NjOA3HTJRb3jvedJQAxXH VSDjly5RLCP+o4dfuWbt/AHUreLzj9lCh6CCLDex2GVw11IoRwHEdKMKgTUYqfFNvnFY KRce3LcRzctgc+KqOi5JWto2mTNrHLwDDiQI1/LPv5p0iEVbXqxplOeKXD/V4bn8TeAu QBq7tlUxlxXB14PalBWdrKKOe+oxFrr6RqPZvU0w6cDH7l1ijRgWw90RxXQ/sjLvIUwB Z/nbmlkEiluKv1/FxE3W/GIhnKP4YzsFNvACarcYcqru5Z7/GfxqF9rpXEu7B667a0AN X/Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IbsnLZNp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b2-20020a63d802000000b003c631686abbsi794874pgh.536.2022.06.07.21.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IbsnLZNp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B3DA04626F6; Tue, 7 Jun 2022 21:32:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344428AbiFGR0r (ORCPT + 99 others); Tue, 7 Jun 2022 13:26:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346100AbiFGRV7 (ORCPT ); Tue, 7 Jun 2022 13:21:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12FB106A7B; Tue, 7 Jun 2022 10:21:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4BD21B82239; Tue, 7 Jun 2022 17:21:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB63AC34115; Tue, 7 Jun 2022 17:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622478; bh=i6RmwyGLlo63FxauOqtVBefNEguj9C67MZ3XNunf8tM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IbsnLZNpc0HTmEY3MO1vUEWR1Dl4gR6CkA+lAqtYoau6qkQJ29K6N05v70yrqMiuL 7CWZ4qLrryNKeJHskOZQU5tXsDVYrGzEYzO0n3o3wz7x9KH6jPRbbYyO6Bsklajoke azaqg+6rmuDJfX+sC4LeDtY7NdfX+HLLbhsOa08c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sam Ravnborg , Daniel Vetter , Daniel Vetter , Du Cheng , Tetsuo Handa , Claudio Suarez , Thomas Zimmermann , Sasha Levin Subject: [PATCH 5.10 032/452] fbcon: Consistently protect deferred_takeover with console_lock() Date: Tue, 7 Jun 2022 18:58:09 +0200 Message-Id: <20220607164909.505647912@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Vetter [ Upstream commit 43553559121ca90965b572cf8a1d6d0fd618b449 ] 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: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Du Cheng Cc: Tetsuo Handa Cc: Claudio Suarez Cc: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-14-daniel.vetter@ffwll.ch Signed-off-by: Sasha Levin --- drivers/video/fbdev/core/fbcon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index f102519ccefb..13de2bebb09a 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3300,6 +3300,9 @@ static void fbcon_register_existing_fbs(struct work_struct *work) console_lock(); + deferred_takeover = false; + logo_shown = FBCON_LOGO_DONTSHOW; + for_each_registered_fb(i) fbcon_fb_registered(registered_fb[i]); @@ -3317,8 +3320,6 @@ static int fbcon_output_notifier(struct notifier_block *nb, pr_info("fbcon: Taking over console\n"); dummycon_unregister_output_notifier(&fbcon_output_nb); - deferred_takeover = false; - logo_shown = FBCON_LOGO_DONTSHOW; /* We may get called in atomic context */ schedule_work(&fbcon_deferred_takeover_work); -- 2.35.1