Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1866855rwb; Mon, 7 Nov 2022 06:43:15 -0800 (PST) X-Google-Smtp-Source: AMsMyM4KCskhdlZXptDKFxVZ9vEInL5uc91tgJANW6WWjKmxgRg3VVf1tzynbK8SvnazSTfwZTYy X-Received: by 2002:a05:6a00:d72:b0:56c:3c45:6953 with SMTP id n50-20020a056a000d7200b0056c3c456953mr50665359pfv.54.1667832195665; Mon, 07 Nov 2022 06:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667832195; cv=none; d=google.com; s=arc-20160816; b=InRwi+/uhk31mzxbjQd3R60sWW6SxgIQgiV0L5Gsl0YMFUiM8m423X//XS3kPWE50d CW/Mgv0ka3JpLahwZZ0hKxeTMG6bM4NIysUAzPr2hA5dd35AOlLs9LXZRBWGw8/7U8aA m/Q0RimP6gl7q2AQGpUMA9+UQ3nsGPBXI/lHytC59YS1rZnV7/ens0kIauksA1hD7dMc Uk9jTg3r43fxR9TiPNANtJd4bQ1iQt9CeRuvhK+W9w7UlIkVX6mOR9ojgnxncNWupVtv NfwSSQCDzjDLplTIiWoii7SYbyH1X8fregSnuc1YHdG+LXHgjHHkuuYgjrNHZd/F6YNu 80xQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=dQqN7WWFfeRk0rEfRkWVolPjdsk8N//2uvtsWSdUdzA=; b=cFjLCl2o7GfRMWxKhKU+M+jqzInxoTGgZpBtGhJVGen8sUHnNns3nwFIV4oKOw/KS7 j41qXLPQWTVDNvbdpCzPcg5QSMhdRXd4uiwzU+x6OX/H8YakRMvTOeKuz34yf7AUD7nT EJPSKFGXsHhJ6kwuOYYDSpRGjNJ+5zLwbd/F7uYblHcxfoG0+/SfimNIhbBkblse+KVd CG0YBAU2qPjHiHjUM0yvRXJroacuEtJdsUlZVsq7FEvU4o7izht5OG73DsxKm8Z6EFva ZsSaIYqHG0OPZB73I35KkuB5Duja4IiwGEGOOR8Tacar4LsRpzkIdssAmQzt9wdbFi44 FX8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1AfBH1Y1; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=tjQDm3eX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o20-20020a17090b0c9400b001ed40b70436si9217670pjz.155.2022.11.07.06.43.02; Mon, 07 Nov 2022 06:43:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1AfBH1Y1; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=tjQDm3eX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232180AbiKGOQw (ORCPT + 94 others); Mon, 7 Nov 2022 09:16:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232010AbiKGOQn (ORCPT ); Mon, 7 Nov 2022 09:16:43 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 187F71CFF6; Mon, 7 Nov 2022 06:16:42 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dQqN7WWFfeRk0rEfRkWVolPjdsk8N//2uvtsWSdUdzA=; b=1AfBH1Y1iFfphLxwLDzchu0JtFa4StD8+vHmibnAtoR7r0d9yVZ7XudeFA2hxeTHvPJNO1 ofQxZT3QO7S3AIt5J6jw1rTh+uGC+ykQ2zYmR+fMAtYm0/E/+eRNResYTvMXDWeXtDpBar RhKMrMIijaLU7Ul+Ipvhji9wlW6zaf4LkCuyg9BfVvQ86fLD3DZvTVIe3aP5cl9i7e1Ysy pPuGSq0stzuTH4IF+pPHEL72It1Z2+S8gqw5e/hO3s7QnrkrXM3RZ19pIP8Lh/W5WzcknX 74CdrAlyEh6Swq3T12qX0WpMC7JL0DFBPsUAxGiCsJktqmJZ7DgpuMEBJysaJA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dQqN7WWFfeRk0rEfRkWVolPjdsk8N//2uvtsWSdUdzA=; b=tjQDm3eXUbLBxw7+a927SUadjeYu0UPY5exQDo0Y3czHli8azPa+URgzRubTdplWFAe0Jt zSX0xI8ffcVGXtCQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Jason Wessel , Daniel Thompson , Douglas Anderson , Greg Kroah-Hartman , Jiri Slaby , kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org Subject: [PATCH printk v3 02/40] serial: kgdboc: Lock console list in probe function Date: Mon, 7 Nov 2022 15:22:00 +0106 Message-Id: <20221107141638.3790965-3-john.ogness@linutronix.de> In-Reply-To: <20221107141638.3790965-1-john.ogness@linutronix.de> References: <20221107141638.3790965-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: Thomas Gleixner Unprotected list walks are not necessarily safe. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Reviewed-by: Greg Kroah-Hartman Reviewed-by: Douglas Anderson Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek --- drivers/tty/serial/kgdboc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c index 7aa37be3216a..e76f0186c335 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -193,6 +193,7 @@ static int configure_kgdboc(void) if (!p) goto noconfig; + console_lock(); for_each_console(cons) { int idx; if (cons->device && cons->device(cons, &idx) == p && @@ -201,6 +202,7 @@ static int configure_kgdboc(void) break; } } + console_unlock(); kgdb_tty_driver = p; kgdb_tty_line = tty_line; -- 2.30.2