Message ID | 20221116162152.193147-2-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp232209wru; Wed, 16 Nov 2022 08:23:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf63EqX+NonrXz/obeOtLa9pCUc5FRtQqojLH3SMi2irZBqr95eBX+oDHa9JdZmp0S6R1Gro X-Received: by 2002:a17:906:4156:b0:78d:6ba1:74dd with SMTP id l22-20020a170906415600b0078d6ba174ddmr18493286ejk.119.1668615791009; Wed, 16 Nov 2022 08:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615791; cv=none; d=google.com; s=arc-20160816; b=ooLuRwjO+HJIhbQmN3NuzajMtd/jrHy1ruw+Jhw2Qf5+drwmFUIdlCP8/1tADgMBQA cb/3nf/dWlV/YVCFp2Yasejh7fVC5lxAyZxJLkdn/Pv9RtNmb4635lenEpvDjgQ0DF1H XVeXYLdEotQf0mzGZSNcJss1hQVP2u6X4vmYTf8zeZ6MEgjVljI5Xl6zWTTP4+tjQ+26 kJQJuPR0ivP+G/2XPN2VhTa43IzUc+2Ox3ngMVDWv17Am6m69KlQ82Bp98PN8olX7R5M ysIe3bKUlUKsjvovy7/IRvrRkhXigzhyBW8hIayaTb8+2e3229wakhv9HQt7jyMLWu12 vjmg== 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=MpXDwx4HKdMdBWDyluBjDSAFdjedUOkxkf204NlGPAs=; b=Z2rG+xcfNKSJ04YKn26eSuo39gQIGg27QuoT+A2co6BGTg/8u7blqCX+HxBf4HyUfb yJo8J2+YGxkDbTu0wfHQLABc3O3h/5nJW+PuUjyhYrR5mm4w0XZeqs/6PCuiaHlqdFYP u0lqe2Dm2y61G+pv2oJvCPmcx0LOVAPA3yliCzLZMfQwiDRqXClSHATMsN0aLeOSGbWr Q7HV7BSDOvP+9Tka/pKNo+fdmTTuhhsouPWVUYgTZ0tO3CO3rjzSdOc3yJoPwqC27gWT 4t4HcExPSp5eX3+bvDlcVfWgAnS+F/NJxYWvVD9cC1QYghsQO5zAeyzYJS65sPpddRfs Ey6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LqzUIFfW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=KpNtEbzl; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb39-20020a1709077ea700b007aeaacd5592si11863184ejc.124.2022.11.16.08.22.47; Wed, 16 Nov 2022 08:23:11 -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=LqzUIFfW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=KpNtEbzl; 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 S233496AbiKPQWE (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 11:22:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbiKPQWB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 11:22:01 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CAC726495; Wed, 16 Nov 2022 08:22:00 -0800 (PST) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668615718; 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=MpXDwx4HKdMdBWDyluBjDSAFdjedUOkxkf204NlGPAs=; b=LqzUIFfWKdEdiyeDT4SA4emyQt7a9a+2ayMhlNuY8oKBxOZ55QB5G2qQqcYfRRW2xlUICW tBwDtRYB7JMPPvjHX4UxY5ypgN6jVCNWuE/WjNV6Ur8UrMVRcsBmdQuVxrOQ+dqHuMDUTP 1qm5jh0qN+dcqhLR8NCFhFcm/ntrqaL7JO1PtX4eXnjEtGvhUa+irm7Cqewqp/dPHWPpir loS78h/J/Y2VzMyenoQlqx/7uSrTjLRrp4Z4Gv2Or3yKv4I7e9jJ05pSDNY5sngtzthllA BYZqI6OU9WxkkKJuMK1lZhzdDMcEAvjzz7rJiL8FLy2y7oOwam8IlCUML4DVHg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668615718; 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=MpXDwx4HKdMdBWDyluBjDSAFdjedUOkxkf204NlGPAs=; b=KpNtEbzlAdwIW6nKnDTQJbZW60PKBRcYjMQXzivs6ATu0YjHy6ToNZTwuGwHb2+Ivz8DwO UUVw2DECAzI7ufDA== To: Petr Mladek <pmladek@suse.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org, Jason Wessel <jason.wessel@windriver.com>, Daniel Thompson <daniel.thompson@linaro.org>, Douglas Anderson <dianders@chromium.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org Subject: [PATCH printk v5 01/40] serial: kgdboc: Lock console list in probe function Date: Wed, 16 Nov 2022 17:27:13 +0106 Message-Id: <20221116162152.193147-2-john.ogness@linutronix.de> In-Reply-To: <20221116162152.193147-1-john.ogness@linutronix.de> References: <20221116162152.193147-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749670471450402968?= X-GMAIL-MSGID: =?utf-8?q?1749670471450402968?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Nov. 16, 2022, 4:21 p.m. UTC
From: Thomas Gleixner <tglx@linutronix.de> Unprotected list walks are not necessarily safe. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Reviewed-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> --- 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;