Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2058940rwb; Thu, 27 Jul 2023 01:04:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlF6X/KAiQsLL7v5YSsAuYBXRAtogAQcfJ9gPdoKI2FDmPPWTTiTNHfbr79RRDFPH9N/Ws9k X-Received: by 2002:a05:6a20:7f8a:b0:12f:dc60:2b9e with SMTP id d10-20020a056a207f8a00b0012fdc602b9emr5030593pzj.48.1690445071994; Thu, 27 Jul 2023 01:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690445071; cv=none; d=google.com; s=arc-20160816; b=P24KLJUG3VwFxLUqMSKyRFX3WeNiL9ZeOu2wBJfjWFWLAZMpboM1uRoy0qd7S2wgcO sDdhQ6A6Ih1dHAd+ST6GtQ/fosCwUZTQHK/vptkdkc1Rqm09aNSf1v/dWWx5+Um9mESq 4CABZymKvSThqFV5GcSa57no4WD1gOdr1DocjvOHrMdrc4bosVmX7yb0isKPzJYUNkYN agSx3usurBwnApUESN/FpzaoKt/EVtlY2a2piw/mkjjNSNTSHG3j1mMyvm+/1JtJqY5F 51s/9r5CkH1G38Cy1fCnKlcAf/DGDCZHbtEx61Z0Y5Lxk72kIARkgfi1gmzHqzRjS9pX gNhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=V7aXXeMG5voSqU6B1rGakA9WRVzqrKpuEUhdUgn6xS4=; fh=i1r4D7s/VRO+1+z4QTFdYvL0YE2AJXrjiXyXLVp7ny8=; b=RyNJlzUYRKIoMfFmy5WwtGsFfqNrYlYssD/VwLDrDxJXYX5l9sdPqQsQb3e42LVgfu SMZBYg4bmn+QC90Qa8C3X40Eqktd+a/9pSZJN3CbAzBsFHFXI8jbv8N7bHVdh7xesZAf 2p1rvcCKR/VlaJqIr7SIKu3G7NSWgmI2NQJkqBa5royp49VDLk46xHQO1WC+5N1MuA94 5Jw0NRy9Im6g2c9vT1D4Jza9ApUJCphc5rZXCojhD3bpITsizASb0qxDy3K87VnC5jpS I1B2/Hr0BvsrxFdWQGbYcyFJkKaJrymt8iq29eSnMTbORCxDR32E7KpzRxnNOBFGPKK0 pT7g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ef8-20020a056a002c8800b006826c8d5a31si1011804pfb.21.2023.07.27.01.04.19; Thu, 27 Jul 2023 01:04:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233572AbjG0H5O (ORCPT + 99 others); Thu, 27 Jul 2023 03:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232805AbjG0H4a (ORCPT ); Thu, 27 Jul 2023 03:56:30 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C63E8E47; Thu, 27 Jul 2023 00:54:16 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id E76993000A380; Thu, 27 Jul 2023 09:54:14 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id C597613BBE7; Thu, 27 Jul 2023 09:54:14 +0200 (CEST) Date: Thu, 27 Jul 2023 09:54:14 +0200 From: Lukas Wunner To: Ira Weiny Cc: Bjorn Helgaas , Dan Williams , Jonathan Cameron , Davidlohr Bueso , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/DOE: Fix destroy_work_on_stack() race Message-ID: <20230727075414.GA29643@wunner.de> References: <20230726-doe-fix-v1-1-af07e614d4dd@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230726-doe-fix-v1-1-af07e614d4dd@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Jul 26, 2023 at 11:29:42AM -0700, Ira Weiny wrote: > The following debug object splat was observed in testing. [...] > This occurs because destroy_work_on_stack() was called after signaling > the completion in the calling thread. This creates a race between > destroy_work_on_stack() and the task->work struct going of scope in the > pci_doe(). > > Signal the work complete after destroying the work struct. This is safe > because signal_task_complete() is the final thing the work item does and > the workqueue code is careful not to access the work struct after. > > Fixes: abf04be0e707 ("PCI/DOE: Fix memory leak with CONFIG_DEBUG_OBJECTS=y") > Cc: Lukas Wunner > Signed-off-by: Ira Weiny Reviewed-by: Lukas Wunner Thanks for catching this. The offending commit abf04be0e707 was applied by Dan. Not sure if that means he's going to apply this fix as well? Would require an ack from Bjorn in that case. Or Bjorn applies it. Thanks, Lukas