Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1549787imu; Wed, 16 Jan 2019 22:35:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN6n3nlg9Tr/2tSqY++rJRMTfhgmpk229d4HDcupIBvexlxcJSQ7YnlR89yer4unrutVqQxe X-Received: by 2002:a17:902:227:: with SMTP id 36mr13803129plc.140.1547706946203; Wed, 16 Jan 2019 22:35:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547706946; cv=none; d=google.com; s=arc-20160816; b=Jnw5NpFsP8nK7qeSFJOzJwYeeW3jZ11YE2F6/mVU3Vcp0afXxz9oTvLs0uj68TMiDw +8+cWLg4FDsIvDELoP0IkxJAP21ARafeNj2mFUleoF0U+G3Gr9RKKtcsy3T/U8GZ5plL rmfH6TuyifbVnXMnd44+x2O3l1k8eIcpAhglbKBc5XPB8ikkboCdWUR2RR+GWlA2g73Z D3Ahb2Dczy5Mv181fCE4fdtm2PcXctrbNNKAerZoDYg35ZLJU46sN0MQG31heRpEKuyW mBjb7wXaxasqRNtRNJsKugu6RWyU6CPuXpm27U1iaw1KFGkAGhOjiBeG2szV96C/HUnd 2wXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=vaubDGPHphkAl5FJ3LgBZZ9CR27yEoK+TjSzkN1kmGA=; b=rwcan0nPoB6/lppcLwWmQ18Oox+bVG4AE7tzeQMNMj1vtSCjZfuS0OOGxtiAw1+i/b 7M0xOzfsJ5J6gKoyNBhlDT8iSa6sslpewqHS6TmOsE13SMG9mqNyEg2bHwTtPVBZeM55 5FQwaKJy8kGE/Gf4xPP+Ey6iaPFMPvgb6A8KZzHzTUiDiVR2Ih+oyOZrrCbVsL2edirr /RbPI/t+dC4WaDWapS8ByXniln12/Y4x8Dl+Sjry/kViLwe3CsOOB50p5uiFUK4m7RtU wQ/qhypzvh8ZTrpX9xLPzKTk/8EFnz3zGgW11GlLx2Nth0viCeRS8LXim+xFlBLvXhzK AG5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si741656pgk.163.2019.01.16.22.35.21; Wed, 16 Jan 2019 22:35:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728906AbfAPSag (ORCPT + 99 others); Wed, 16 Jan 2019 13:30:36 -0500 Received: from ale.deltatee.com ([207.54.116.67]:35230 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbfAPSag (ORCPT ); Wed, 16 Jan 2019 13:30:36 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1gjpxR-0003Sc-G2; Wed, 16 Jan 2019 11:30:34 -0700 To: Jarkko Nikula , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Cc: Stephen Bates References: <20190115173203.14850-1-logang@deltatee.com> <48a93172-25a2-d6a6-e908-7d27249f1bc2@linux.intel.com> From: Logan Gunthorpe Message-ID: <44629b35-8315-c090-eca7-ca1e9347ba13@deltatee.com> Date: Wed, 16 Jan 2019 11:30:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <48a93172-25a2-d6a6-e908-7d27249f1bc2@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: sbates@raithlin.com, bhelgaas@google.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, jarkko.nikula@linux.intel.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_FREE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH] PCI: fix using __initdata memory after free in disable_acs_redir parameter X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-16 2:37 a.m., Jarkko Nikula wrote: > So this doesn't happen if you revert c5eb1190074c? Yes, but the bug was fully mine in the disable_acs_redir code. That patch only just made it noticable to me. > I guess this is due dev->state_saved being true set by > pci_pm_runtime_suspend() -> pci_save_state() after my patch and now > pci_pm_runtime_resume() -> pci_restore_standard_config() -> > pci_restore_state() reach the pci_enable_acs(). I think this is possible > to trigger also before my patch if device has the runtime PM callback > defined? Yes, I also think it was possible to trigger without that patch. I just never hit it. > I wasn't able to trigger this but I saw > "PCI: Can't parse disable_acs_redir parameter: " followed by a few lines > of junk during boot when I defined pci=disable_acs_redir=0000:00:xy.z > which disappear after your patch. Yes, I guess in theory, it will also depend what happens to the RAM the parameter pointer points too. On my system it's panicing trying to access unallocated RAM, on yours it may be reading RAM that's used for another purpose and spewing garbage because of it. > Tested-by: Jarkko Nikula > Reviewed-by: Jarkko Nikula Thanks! Logan