Message ID | 20221019145600.1282823-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:4ac7:0:0:0:0:0 with SMTP id y7csp377671wrs; Wed, 19 Oct 2022 08:07:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5GSMAb1vnoeQIDVOj2gZAZFY+8R0FPC06ftR1HrupvQ/itN+BMuTlrt+QamFYMAkJs5maA X-Received: by 2002:a17:906:da85:b0:741:40a7:d08d with SMTP id xh5-20020a170906da8500b0074140a7d08dmr7541141ejb.263.1666192060099; Wed, 19 Oct 2022 08:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192060; cv=none; d=google.com; s=arc-20160816; b=DE3P3iaYMNas2qVxaQUvE/bcqGY5UDBs/iYJI36ETe474eX3mhJ8+HHAcgb0ETsBUt 1bGPrRQt/r/De5YEF1ISVQaCNS/xQdb4VMBSPDS2RfIQ8GFofJznAJ0d64Mlup/knFgH 4BmKtSGS/1vUz9QYSAv1ITlLtO2ncdziFpzSKvoS+korBxhIQqe9GzDsDsDxVhX1rfYr PMof9RF6vpmqAU2qeFgYKZ5Wn7h0FMDCvpv7tNO0JJR5zzE3J+wrJXwtDn9UUG1+z4a6 lmKqSELoX3FSdjSKg5GpUtVo8gLSX7Un3zRunUqPLqtYFHI7/pLGPnxX6hrm/mmFJOsS Hb7A== 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=NEhmZhH2pnDE6WuTxQwMCcvi/RbMP+L4l7DVKXhScfQ=; b=01d6tYg9jyyt70RnWgtDOyUlG7bBg7q/FYigf1rxtTQbeFTu+4aNAOKYwc0dvvxK1/ ZMuPAlJ1pipT9vC5N4U3uuEufBnBtlI4bWtl6Cx547OTg1kM/ZfdrTXViiP3u92silSE C4SUWICwEB7H0pFAuSr6DDxq83MJf48lR46WXay3wvgogtGZxEk40gWQMuSGDw6Ah7C9 4HLhi+EjshwsvV0u1hb6IhbSTeDCg+YE8CL+dGGrxoAJl4PEB3S7LJEnxV3Qx16wqviI RpUEzOs4pfBLdB7sFP7QaB254tAdtc6osZhqlTwTWR61Fv/e6wiLSOiv3NlG5b6nTiBi CttQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WkJA4pqm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=aDl1Im9Q; 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 q12-20020a170906770c00b0077f4362c957si12361546ejm.702.2022.10.19.08.07.04; Wed, 19 Oct 2022 08:07:40 -0700 (PDT) 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=WkJA4pqm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=aDl1Im9Q; 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 S231824AbiJSPDA (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Wed, 19 Oct 2022 11:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231282AbiJSPCq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Oct 2022 11:02:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A777C15D0A5; Wed, 19 Oct 2022 07:57:25 -0700 (PDT) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666191363; 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=NEhmZhH2pnDE6WuTxQwMCcvi/RbMP+L4l7DVKXhScfQ=; b=WkJA4pqmnV5juPN/ttgFR+jALEcs6JiTFkAuj55fv1Kc9Cx9UAm1N2rezLQc4WaDTdI/Ez m/HFdf7pZqHhdxeVSxmJ/wOoDKSjiMkAqJ8syecbdqYLzx9aZNdxjA9PJjkX7XcCeN9bSn bNe0JNx3plnLRTHu6/TZEDVzHEPTgZuc1wDuCH0zd719J7sckLPTqVJ2fAeNX8P7melcni 0q6XH6+z5F33XWbnvc5mJtt5eRYubPRu1pN8zAtwSWT7NlR9AjihtUMfpyxtPV4FPukpwg awmFOtjaGtFa430Q5t3JRNOLPoKJdpHRQeR0xyjB/xzpitnezB7/EUhmrWpzGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666191363; 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=NEhmZhH2pnDE6WuTxQwMCcvi/RbMP+L4l7DVKXhScfQ=; b=aDl1Im9QlC7jXBpafB/JPa5shMExjhVLO58+NwKbR8EV60/QUyHkbiIXWH+jwcsUkqMUn9 dwjFqk2pmsScIoAQ== 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 v2 01/38] serial: kgdboc: Lock console list in probe function Date: Wed, 19 Oct 2022 17:01:23 +0206 Message-Id: <20221019145600.1282823-2-john.ogness@linutronix.de> In-Reply-To: <20221019145600.1282823-1-john.ogness@linutronix.de> References: <20221019145600.1282823-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?1747129005698716802?= X-GMAIL-MSGID: =?utf-8?q?1747129005698716802?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Oct. 19, 2022, 2:55 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: Petr Mladek <pmladek@suse.com> --- drivers/tty/serial/kgdboc.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
On Wed, Oct 19, 2022 at 05:01:23PM +0206, John Ogness wrote: > 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: Petr Mladek <pmladek@suse.com> > --- > drivers/tty/serial/kgdboc.c | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
On (22/10/19 17:01), John Ogness wrote: > 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: Petr Mladek <pmladek@suse.com> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Hi, On Wed, Oct 19, 2022 at 7:56 AM John Ogness <john.ogness@linutronix.de> wrote: > > 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: Petr Mladek <pmladek@suse.com> > --- > drivers/tty/serial/kgdboc.c | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Douglas Anderson <dianders@chromium.org>
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;