Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2083619rwb; Sat, 24 Sep 2022 02:40:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4krqRAVRqRoFEQ51wDTQxPknn0g/MyLSZmRvLaQDsdBMGJCT0Krp3MF3A44Rr336BwT/BJ X-Received: by 2002:a05:6a00:14d3:b0:546:e93c:4768 with SMTP id w19-20020a056a0014d300b00546e93c4768mr13009848pfu.36.1664012422215; Sat, 24 Sep 2022 02:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664012422; cv=none; d=google.com; s=arc-20160816; b=se7EvWk8BXqmuoOIYFjS2UGh7YsRBbiRoV45KaISlPQTMSIflNPaNbQ9mNlH2V4cMH 7EUI2eEhRbyBG+aPMT2+P+U+M2nlXU92zA1A+T9oJCAkcOntMxC0k79VkIwLuDEtaePj dxY69qqEW9GCyhfuC0QQsC+pgP3ul9bqpHfGTOPXubw8AJVYAgXW3WHu1PsV/HHeT6Fv kWNjOn9NxOo5wiKIH4CkyS15p781qxjk6FyoVoWvaOxLGbzchCxhY5HQLaFZ8HEKKBrI gYWMn2MYWIouk2dGhvh2YxAXvp4Ai5B5wPuIorbgjieGIT3l/3psHMhrNXESQ84GUZEN lQZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ap8HLLGn4DzoVPJQkiP9TLAFfA/XSqaqZJCMd1CXIUY=; b=LDMusNFHAJfPrK0dcwL27GwZMqvkOMxZPlpbmDCCy//vP942plxXNqoBDljUsu7kgL 73n832nATX/ZGBsOidDWFa6KjCI9e9egJncGXhT7Uzan9cQA9Hko9oMugO0CaY/zQPXt 3yp6JQdPpk84qVtKG808hbgnEl4Txvoy8H/vYLNxLoyVBPZcu6TZ80DRcFpHqWs/scLf 5gzh6SERJZae/DZzrksVxEczLK9/uItvhmRqYVmuL1hJH2vtD9h9q0c0nUgACZimFQuU 6oGnO5tWpAgRd6AygEv+kowlYzY4dtkIppbFNbPAxCXlGR0KzDo0eBjU6I0u3VNkVdm7 crkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EN4DIZ0V; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a170902f54e00b0016641a8abcfsi5934366plf.549.2022.09.24.02.40.10; Sat, 24 Sep 2022 02:40:22 -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=@chromium.org header.s=google header.b=EN4DIZ0V; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233607AbiIXJbw (ORCPT + 99 others); Sat, 24 Sep 2022 05:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233584AbiIXJbu (ORCPT ); Sat, 24 Sep 2022 05:31:50 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4A0AE6DCC for ; Sat, 24 Sep 2022 02:31:49 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id i15-20020a17090a4b8f00b0020073b4ac27so2353558pjh.3 for ; Sat, 24 Sep 2022 02:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=ap8HLLGn4DzoVPJQkiP9TLAFfA/XSqaqZJCMd1CXIUY=; b=EN4DIZ0VBUazYKX6uD/RpmQ6koSVqAbwc17Xe1qpx38st2H0qNoGKoaLUlTRC2Hh/5 +l6BAuV+4E9BWrbUyb830iH8xTaPWiWvyzBZI2Jsw3YpKBqG1AbLCzScYcPCf3vwOOhV DBB9IjYyC8XAtI74riFLsKBfZEBOS1RBn+fqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=ap8HLLGn4DzoVPJQkiP9TLAFfA/XSqaqZJCMd1CXIUY=; b=RGvTJjYXarA8pziVDIj4bI19TL3HugYrfoPS709a4D23cXjypdNDEMMzCvcLZpTWKz r6+mV/dU/cj1r0RXjNQUaSoU6eBCzBJ8fzyMolSYw4oW51VtKv2/KNqBIrQgPVjNuB3i NO0e2HAddPfsVxsZ5TdGEYn8cyn/otwlTiO6VW3DwxexIXN9eyAmeYEB1qApmNjcottm ibbiGN0jsuQ/NhD2BMVhgOhJoftmM5j7Cy7lRcN8AZQtUOU3mXH1VHeRE3JdHBbJVAUj F8YP/JhQeTT/cmEKnDjfo2f8qy7a6vyr48coC8Hw+Vbqf62Su0ktqxjm/CjRKAXFzilv xxJQ== X-Gm-Message-State: ACrzQf2kDDCrnlNTtf4jEjUWK4aEXGCUCeTCTpogKKxBdxCkCtcwEqPW Hj9JzMKK1jsgOe2Nmft/NsCYnyossz/Tag== X-Received: by 2002:a17:90a:bf18:b0:200:8a12:d7ad with SMTP id c24-20020a17090abf1800b002008a12d7admr13787822pjs.243.1664011909480; Sat, 24 Sep 2022 02:31:49 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:f4de:2419:efa3:8fed]) by smtp.gmail.com with ESMTPSA id 9-20020a170902c20900b00174f7d10a03sm7505874pll.86.2022.09.24.02.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Sep 2022 02:31:48 -0700 (PDT) Date: Sat, 24 Sep 2022 18:31:43 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH printk 06/18] printk: Protect [un]register_console() with a mutex Message-ID: References: <20220924000454.3319186-1-john.ogness@linutronix.de> <20220924000454.3319186-7-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220924000454.3319186-7-john.ogness@linutronix.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On (22/09/24 02:10), John Ogness wrote: > From: Thomas Gleixner > > Unprotected list walks are a brilliant idea. Especially in the context of > hotpluggable consoles. > > The new list lock provides not only synchronization for console list > manipulation, but also for manipulation of console->flags: > > console_list_lock(); > console_lock(); > > /* may now manipulate the console list and/or console->flags */ > > console_unlock(); > console_list_unlock(); > > Therefore it is safe to iterate the console list and read console->flags > if holding either the console lock or the console list lock. > > Signed-off-by: Thomas Gleixner > Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky