From nobody Mon Apr 6 04:44:18 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DF95C6FA82 for ; Sat, 10 Sep 2022 22:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbiIJW2g (ORCPT ); Sat, 10 Sep 2022 18:28:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbiIJW1w (ORCPT ); Sat, 10 Sep 2022 18:27:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EFFA3DF2E for ; Sat, 10 Sep 2022 15:27:48 -0700 (PDT) Message-ID: <20220910222300.906633712@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1662848866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=rf4oVT0IACM5+HOOtRh8ktCU4mJox5gT3mFbY4X0ro4=; b=xtXfpQ6xb7JeebjIdPGSmF2S7V4YMW5PUyCRbpQ0AjBGRT7a1eyRCqZU8zY8pvGVlwzW+5 KoezmY0Btk93Trb9iWm3Agn5nLEbQn5g3XmuIjd0lOeYB/5P2UX61czgUd3Kvi3h7ZBWVJ Cj3/AOCXU4iesBaoy+fB0bxD8TsUJHkXeA8xxatSKxKi5DOlKV0kE0Fe/659drk7Z1L9K2 jYHhGdbT35Te3z6ESKqbZ/mYJHCNdRA7+acOLTPI514y1itsZlSys2SwtquG+niT0XMroF D9Pwl67aWngtgHgJXXw8gcJZYzg71y+S5JF2Sa5g5UlbvgGGH70v3NTVgkwW8w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1662848866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=rf4oVT0IACM5+HOOtRh8ktCU4mJox5gT3mFbY4X0ro4=; b=MlUd/ANlzRpMXw1CNhR9CQYjifzNbwfkl52XRDH07kXzghewtr+0JfNxo8jDgBhHgMHnGE +qYj4H//NJlD87Dw== From: Thomas Gleixner To: LKML Cc: John Ogness , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Peter Zijlstra , "Paul E. McKenney" , Daniel Vetter , Greg Kroah-Hartman , Helge Deller , Jason Wessel , Daniel Thompson Subject: [patch RFC 09/29] serial: kgdboc: Lock consoles in probe function References: <20220910221947.171557773@linutronix.de> MIME-Version: 1.0 Date: Sun, 11 Sep 2022 00:27:45 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Unprotected list walks are not necessarily safe. Signed-off-by: Thomas Gleixner Reviewed-by: Sergey Senozhatsky --- drivers/tty/serial/kgdboc.c | 2 ++ 1 file changed, 2 insertions(+) --- 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; =20 + console_lock(); for_each_console(cons) { int idx; if (cons->device && cons->device(cons, &idx) =3D=3D p && @@ -201,6 +202,7 @@ static int configure_kgdboc(void) break; } } + console_unlock(); =20 kgdb_tty_driver =3D p; kgdb_tty_line =3D tty_line;