Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp527055qtb; Wed, 19 Oct 2022 08:08:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4bwO87SkNAiOThgSi7g6RIK33y4OumoGHyurFuPHIMEpjaPpPhPt31u5QZ4UT72qmDpAOU X-Received: by 2002:a17:907:3da5:b0:78e:793:4084 with SMTP id he37-20020a1709073da500b0078e07934084mr7286726ejc.285.1666192122215; Wed, 19 Oct 2022 08:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192122; cv=none; d=google.com; s=arc-20160816; b=hw9UyUcz8JK1yXJAbpPOoKqc/vgC+N+nDwvRtZsP93TLmJBR3lpfNxAzbD0HYxkpWe nbK9O9AYRUEXPzzxdGhgHa8RVBtNVlPQfbur2RCTHwyXBMEpVoQ2hSS8nebYAONCUSXo +gqVFnO2x657FvVbw3wGjDXYXXZZ20kd3WMrwHzd7vv/ABwgYtMKw33Gb16gDtXdurRU tSLSQ0Xznt2XoPUtO46fzNYzcQl1BgyBySQuGHI/UKLB7off0smLucTWhZI0TJ6sdEX8 J+3OD0C21Q4CEh6UASg613IRDQ+V7mnCDHuW6fw03JWl2RV20Y7+hG3xU/fXWG7Qjsw6 pLmw== 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 Return-Path: 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.08.13; Wed, 19 Oct 2022 08:08:42 -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 + 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 ); 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 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 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 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: 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: 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