Message ID | 20221114162932.141883-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 l7csp2237638wru; Mon, 14 Nov 2022 08:30:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Z8GYA/OGiqFxvWVzST5fvhkp9k2Y+9+SeYk0Z7dlRXuZWi86LB+1+XExRmDyLeb2ShUxm X-Received: by 2002:a17:903:241:b0:188:6300:640f with SMTP id j1-20020a170903024100b001886300640fmr16857plh.124.1668443433502; Mon, 14 Nov 2022 08:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668443433; cv=none; d=google.com; s=arc-20160816; b=ag+IMg8TX3X7V27/mt7fXnnb52ALwSu/DT+qNYpFVRqlNecXwTUkkf9wGLXptnSvQv jEBRGuVEvSqM7fAoSAfH+98sLTN7kKNSdTDCFiHpefaiS4SjwpFMCMZak3TXXZTbxWzB JKnpbccdzv7mAelhk87cLf1QcbWiMEUX6N1ZaH4RCkN7SL044VYJUxDLDWC8q3B4N5AR GRauiVAEhs4rDieqpmiTV3bgQfdNeKDsy2Y/uKEV+oBzeY5vVenD9aIkxFBeNY59Vjdd r7/3LjijS98QY/aqZSyJO6sGe/kcj0cchv8Vu3+VSxNLlA9gTlNvxkN/UIhJQPcS9AYS YuPg== 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=z+ceWAnsa/KUYKS9eQMSdOvjkUPTK0IOvZae2YpXUz647EyOov2Md5eKe0J5L8X/2G 8RQdZ3WB6HQqSwdTG1543i+FSqUqOqaw5eU8p1XZKaN8XCcTLBwemFPdIgTsJMHnyJyQ RnfmfNTt95h1fSy4ASvPDFj5zeSuIC2gp4BktWac2/44BO06A6W6at8UAIbpPDr8T7XO GqD+Y2KLPnnhh5crH6ZQ2ECyJb4Ev++q534zerxRXvx2QorwsWes5LIIQ8x1dahrHEKe ERDeIZG2boPYrMDFdj2lmxbnQNCludVi8m1OnqK0UcPZSBsZMGPiRPStax12bB2Od4c2 Y0FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZIb+4NiG; dkim=neutral (no key) header.i=@linutronix.de; 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 cr15-20020a056a000f0f00b0056300ad8dd2si9013585pfb.367.2022.11.14.08.30.06; Mon, 14 Nov 2022 08:30:33 -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=ZIb+4NiG; dkim=neutral (no key) header.i=@linutronix.de; 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 S237527AbiKNQ3p (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 11:29:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237437AbiKNQ3i (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 11:29:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F73E53; Mon, 14 Nov 2022 08:29:37 -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=1668443375; 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=ZIb+4NiGcX3L5i14ZL3n7tyukxCFrzAaN2u/yt52dY0OinERwz3VqBV0iF7GolWDeFJnsS svoW/OdbNhOb7rb654aqbqcDtFwbYfHWhVZ2ceuMPMcmhjv0V1q3gI9oTYPoEvd8jv81b2 ma9pcNTXKnS70k2gFZOc7Mia1+4plCCQeNOoytXM9nVFKXzKRZtPhuY59fzFOSCKq0RZRA poyjWM9clrOP4N2sx47bznvDPqWcHfs5npYE93Qb0Y0jv9sBxSYz56D2YmtmCZohhyLeYI KMrf2UiGEmrv9Y3gYhZPaxYcx475ZwaukWQ0CpuTNgN1i+6jxNyGMVDu29ZVDQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668443375; 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=rHBzMhUuyyCGljjYgo6M9g2z9ptIJHtaTE0co9JJYi84qxrRS2zWgGLSRMhVC57vB7U60l V2qJLfb/YvGXv+AA== 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 v4 01/39] serial: kgdboc: Lock console list in probe function Date: Mon, 14 Nov 2022 17:34:54 +0106 Message-Id: <20221114162932.141883-2-john.ogness@linutronix.de> In-Reply-To: <20221114162932.141883-1-john.ogness@linutronix.de> References: <20221114162932.141883-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?1749489741810101025?= X-GMAIL-MSGID: =?utf-8?q?1749489741810101025?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Nov. 14, 2022, 4:28 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;