Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3147398ioa; Mon, 25 Apr 2022 19:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCTwc2iwAsrj1N4elAoL2V1Te3lI+SJ2WCiaiM1iN5tj2YCqceESwHnD+60Q51gej2PNaF X-Received: by 2002:a05:6a02:106:b0:36c:96dd:8c17 with SMTP id bg6-20020a056a02010600b0036c96dd8c17mr17971786pgb.190.1650939597100; Mon, 25 Apr 2022 19:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650939597; cv=none; d=google.com; s=arc-20160816; b=rGdwtrl+Cx9yI+pZCbueypVaj29gOQG341W8NMSRKVG35BS5LaXxjEeqgQQyBfTVfQ BZCTnL7fxoMbBIdsl9UbStnWmTIKULsGoVmJC1+pY8yMDkQc7rQvpq3yG/wXC1DsucQ6 UEuqnqFIVRUr0pr6EI5Faas5FRYMYIw265bOTdsfHoRsFbz4yLAO1ee9evp2Fa88W6I6 MmANn9pttTgglJra3/X/Mylxmv3nlbNC+enkXA/0Y/hkV10AyhRbZlvU4c3NGNNcDkwj DnNsEFIQ2AQVtCp8m33n96h5dEu+YVqvbAtOFfULp+gO536uwoymp6uIZ26CKfptPNZB 3XZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=kmfq8fzVoEHC3SLS8iOyzMnfjBRDrka13gMWgVL1LSo=; b=EJqR+x9+N+wcvlE8umbZctL8R8lOMNT8+LQh9xu7R4HL1F8GzXou1nO71Jg9lKpuBk j6m2c5lUDJP5EtxJlXi+KEVU1hTthEZkAuq0teejak/Uq5kusqPKYYrzTsi7oUmbCjgD /De+21LFIoYljAmZ3om7bTCcH8F9HO4NNFLy7KAhmkfFmIETwl7dHkUAfVrVuc1X20tx tyzHhADUQM8hZRaFIIHe4qp19Q4hGH5fZ4RjpNfvblZc752hKtD6CzG8w5Dc8jo+G5L8 2U4DGQX2Gp4/cw3hCexfK3SQ6sYPDRVQPtqVZtNsa6jply6Yb4iOTU8AFC9MigW3Smua okDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XHzJHtJA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a170902e95200b00158ea24bbb5si19035097pll.197.2022.04.25.19.19.31; Mon, 25 Apr 2022 19:19:57 -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=XHzJHtJA; 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 S244972AbiDYTkt (ORCPT + 99 others); Mon, 25 Apr 2022 15:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236023AbiDYTks (ORCPT ); Mon, 25 Apr 2022 15:40:48 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1A8B111153 for ; Mon, 25 Apr 2022 12:37:43 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650915462; 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: in-reply-to:in-reply-to:references:references; bh=kmfq8fzVoEHC3SLS8iOyzMnfjBRDrka13gMWgVL1LSo=; b=XHzJHtJAhv5AM/TDaBJdYPi+iUnnHuIlPazyyRW5+P1oAN/MIgmHiVO9Vy/b2yK43im1o3 3w0/mq/K3uvDuVs2pIkUWkgA1puDPY1xDejfLrgZy73KVOvgrF3YyDstlp+b0S/aYRi7VI 4vH3MFFG7hKP05o2fwwM5NMXRS5yVEOGNgI/aIteuNwsI0Z7xLGATgf106+Y72E9YbqMs+ RmgUPcrCn0p2vF53qg3+ZjsLRS1SN1SwFaI13x+/bvF4FMU6wbcyPl6tiI2FWiD46WTYQv 3OQ6r/58Wt3lSlrDOT0y0sJEbxGY/BHhjvjkfUMj0gEtTIsTMjy5Y5Wzm+Q5Bg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650915462; 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: in-reply-to:in-reply-to:references:references; bh=kmfq8fzVoEHC3SLS8iOyzMnfjBRDrka13gMWgVL1LSo=; b=lh5hgOI59S4pn6X/KYSmqpxbOYHkPq0C7iK5XCXqJ6CuvBZm07XAQzRDWVxwVq4UHf0FBa nLrieppdwqWn0eCg== To: Johannes Berg , Mukesh Ojha , linux-kernel@vger.kernel.org Cc: sboyd@kernel.org, rafael@kernel.org, gregkh@linuxfoundation.org, Kees Cook Subject: Re: [PATCH v2 ] devcoredump : Serialize devcd_del work In-Reply-To: <8186de033c87f0cdec296ae272a72c5b9a2880a3.camel@sipsolutions.net> References: <87levt14kn.ffs@tglx> <8186de033c87f0cdec296ae272a72c5b9a2880a3.camel@sipsolutions.net> Date: Mon, 25 Apr 2022 21:37:41 +0200 Message-ID: <878rrt0xa2.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Cc+: Kees On Mon, Apr 25 2022 at 19:19, Johannes Berg wrote: > On Mon, 2022-04-25 at 19:00 +0200, Thomas Gleixner wrote: >> >> Johannes, can you please explain whether this immediate flush in >> disabled_store() is really required and if so, why? >> > I don't really know, as I remember that requirement (or maybe even code, > not sure) came from Kees, who needed the lockdown. > > Given the use case (ChromeOS?) I'm not sure I see a need to flush all of > them, since I guess a typical system would set the lockdown early in > boot and hopefully not have a crash-dump around already. > > That said, I don't think the diagram you made works - fn() during the > iteration is guaranteed to be invoked with a reference of its own, so > the put_device() there can't be the last reference, only as fn() returns > you'd put the last reference *there*, freeing it. Bah, you are right, it's magically protected by the klist ref, which prevents devcd from going away. Damned obvious. This really needs comments why this all can magically "work". Thanks, tglx