Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp856795rwb; Wed, 16 Nov 2022 08:31:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf70u3OAKm4zhpe559zi1y81Jpn248U7r2zTypdq9SScHAeJDXL9rte05HFHtxsnrkHcRZ6I X-Received: by 2002:a17:906:2b94:b0:7ae:5ad1:e834 with SMTP id m20-20020a1709062b9400b007ae5ad1e834mr17963462ejg.312.1668616297778; Wed, 16 Nov 2022 08:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668616297; cv=none; d=google.com; s=arc-20160816; b=de+BkFrMXuhrYesvaeMdEgap7TrRIyluP5qiG6Q650ysxyndCLzFc0+m2NLYyh+t04 VqnrCnIGEH2TUkPxYETBQW978AvPH7q4K8WU3SVSfLzLQzNQO5jSf/v8qFdwdj+/Kmgn 6mkvC73/sLbXGeO1e2adxjq+sMbGrCAYquoNQaC4rhYOGsXUt8cxSekVp3VOXmj7fe30 unXDDAaAygC3sJy5l61yt3Gp4tqGj8gBmQ15HI9h2JrD5EqzBPQhpBjlSKjBb8MVCym9 6Q88wFw9BSZZsZkwxT2JaBlZck75RegGS8poAo0E4+5mAth1BJmdPKQEogqfEu/7t8VC N5Qw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb36-20020a1709071ca400b007a45e4f4ff2si17642058ejc.853.2022.11.16.08.31.15; Wed, 16 Nov 2022 08:31:37 -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 + 92 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 ); 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 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 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 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: 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 Reviewed-by: Daniel Thompson --- 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