Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2110137iof; Tue, 7 Jun 2022 20:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8MO44XLSdxVkghzIfkFsd31XuhDM32VC/6Ofqjapb84vJEaiP+mt8lyvYiGwOfSw+dfkW X-Received: by 2002:a63:81c6:0:b0:3fc:9480:5e3c with SMTP id t189-20020a6381c6000000b003fc94805e3cmr27946954pgd.529.1654657459522; Tue, 07 Jun 2022 20:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654657459; cv=none; d=google.com; s=arc-20160816; b=HZiolKNRuX+rGmzZd29ecYZtuB4/wnar09fYzqcehK8UE+xq3Woz6EmF5WuqIgytzZ jcuBx46jqYQMlIqpjM2/PXr4Ua8+KVwe7uxFZ8AsDKlMphBh/32ODsFf6NO/rBuUSmLR IWEFOoBDhIDzr/wlS++Kvmi8wehq0/U1RqUH7kkipdhmNMTA/c1kCHTSwow1kUllNxxb CqTsuFtGfGMC9eMmsThuCggieQ7iTQ1PokXpvH8E9l2GYaS/rl6uXMEvrQOgim507tRR oywZY4pymR4hi7aRdeSBGmrM2wofqHHij91RJqbmHC3TokwNXVq2L2ggO/WXYlYXT8NA 9X5g== 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=G4r2pXkfYbA3T4k3DvYZkjQDc3diN3eZoehZW/8Cz5s=; b=dJwy+DqN1MeKGFUXHW3V+8Y/Z1YhKfv3roRlUTayCHilGqn4zyDmIqnJ9dZXGGeXT9 g11Vg4KQU+gsGfleY4nBBKl6pGe0B1Y8xndiLdt71B47dl1yRGfO+h9an1SgZToXk4Jn HxTw51GWQqaNnnppKNgIFPIJXIudEBnVohto7LvhNcFk4Uq9FnO+MdmzX13qvU+QVnBa uXDAfvvPLMYXBd8Y+TJJj8squ8xLdKl8lB3BR0ZObNQMlD8loW11+EFGq5ZHPSOJUJv4 9L8mz53YgDUyon/rn8wC/LDtvmsD0yvA5WCsPBghYbSVupPqX3754CeICXh1lvM/Np84 P5og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Dh5HsKV2; 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 pi19-20020a17090b1e5300b001e86f11b4c0si16210154pjb.18.2022.06.07.20.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:04:19 -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=Dh5HsKV2; 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 D7B8A3D7D5E; Tue, 7 Jun 2022 19:23:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383916AbiFGWIs (ORCPT + 99 others); Tue, 7 Jun 2022 18:08:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379932AbiFGVGg (ORCPT ); Tue, 7 Jun 2022 17:06:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF22212554; Tue, 7 Jun 2022 11:50:39 -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 B930BB822C0; Tue, 7 Jun 2022 18:50:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28F91C385A2; Tue, 7 Jun 2022 18:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627835; bh=+ehzoZ1+4/6eIf04m+qPZ2eANMxYBdwQHqalydfBe80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dh5HsKV2XLmrkmrY8COdebUURFLNNXq2ZZdcMfjQGu9Nty94quS4mp3lK1HNzmv+I oqPFGRWxiwJMUSk4LqB4cDWg4s/v5twUtNzs2sTyU5xDftadS7TU8YN33yIbNjaytV avHat42Bj4CDYoGv+ubMR28YJu/6SVVhaWAoraRY= 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.18 070/879] fbcon: Consistently protect deferred_takeover with console_lock() Date: Tue, 7 Jun 2022 18:53:08 +0200 Message-Id: <20220607165004.723924768@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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 2fc1b80a26ad..9a8ae6fa6ecb 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3265,6 +3265,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]); @@ -3282,8 +3285,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