From mboxrd@z Thu Jan 1 00:00:00 1970 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 2A0D1C433F5 for ; Thu, 14 Apr 2022 11:32:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242718AbiDNLeW (ORCPT ); Thu, 14 Apr 2022 07:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234754AbiDNLeQ (ORCPT ); Thu, 14 Apr 2022 07:34:16 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFB4485BE1 for ; Thu, 14 Apr 2022 04:31:51 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649935910; 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=OhOliN3feJAcg8egEr0Pq0MQjPTQ0OB0mYDEEBGa4ug=; b=GiQqD6pzJn6lo/8W7ye/VRUD6iDDEBwvXkq3RyQ03+yXCsZvDcL5lFu7nWJgWrXs5vTxub HFFucvOHSZdMNxsAbyBTntqCvwLM1H/6nCCOSPrwqixLH8BeyRemiFmpsds9pkAuw2h/R2 sQBNlTYS+WfOGGD4RK/3JBMTXq9w6UjXi45HDBCZrFU4NJYdpaelc69EFYRq0vOrjfzevz QQW/oUm+RtHWdVu9h17eFBK6mlLOhn7XkwpuqfQ53qYWTFAUuRUkrg4QCXkVpMF9+0sJ+G vCfsXI3TWGx/C19CSld9ql1rK3vdOGOcQjvZeYYPs63GCcJ/dELGdtvhctEDkQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649935910; 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=OhOliN3feJAcg8egEr0Pq0MQjPTQ0OB0mYDEEBGa4ug=; b=4AKUXXK22wjmcqompFNUy6pFMfHLVgAS7l2EUAqGqeK+a7pdsSxcfN+yhAicoOQGpDKoak wncdRjLSjrE+fDDQ== To: Mukesh Ojha Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, sboyd@kernel.org, johannes@sipsolutions.net, rafael@kernel.org Subject: Re: Possible race in dev_coredumpm()-del_timer() path In-Reply-To: <20220414112055.GA14124@hu-mojha-hyd.qualcomm.com> References: <2e1f81e2-428c-f11f-ce92-eb11048cb271@quicinc.com> <20220413101639.GA24349@hu-mojha-hyd.qualcomm.com> <87pmlkdk6i.ffs@tglx> <20220414112055.GA14124@hu-mojha-hyd.qualcomm.com> Date: Thu, 14 Apr 2022 13:31:49 +0200 Message-ID: <87k0brew9m.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 14 2022 at 16:50, Mukesh Ojha wrote: > On Thu, Apr 14, 2022 at 12:38:13PM +0200, Thomas Gleixner wrote: >> So, yes this needs serialization of some sort. > > Thanks for understanding the problem. > Can the patch mentioned at below link helps with the first problem ? > > https://lore.kernel.org/lkml/57a04278-0a60-cc7d-7ce8-a75c2befd568@quicinc.com/ Something like that. >> Same problem vs. disabled_store(). > > you mean, while userspace is reading the data and suddenly disable_store() done from > sysfs. No, that's not a problem because the reader holds a reference, but it's the same problem vs. initialization: device_add() disable_store() devcd_free() mod_delayed_work() .... Thanks, tglx