Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3796135pxy; Mon, 26 Apr 2021 09:56:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9D+bRzDPkQntSl+Ft4fn3ml3eevceUmt4dYtNleCr1njtppXS6RII9UJz0y4tzG8hr/I1 X-Received: by 2002:a62:7592:0:b029:254:ebcd:802b with SMTP id q140-20020a6275920000b0290254ebcd802bmr18379768pfc.41.1619456175008; Mon, 26 Apr 2021 09:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619456175; cv=none; d=google.com; s=arc-20160816; b=Fiog/0guYHhOR2TL+GT6f9TVLcKw1LqNs/sJhMvUYZ0kWpwRG5QYMS6BYgpCusK6kW EoH6uAHdDr7zVNGMQey2aNGUly9g8B2bx7X9tLET+/H+5XK7tjHcE8ItI/MnahhIFTsv caGaK2gZxslIh/+ZSqmnEHbM3xS1xUlJ71gmuh/joFtlkLAZlpHhk3vLv9pHtoL1jV+t Ca1hEtGGrhQ1JFWeXGuk8PcKMSuiCf9Q8TVIWgfiWTCzpI/5+7N1X/lY/AJLk0cRorfQ oK3t5wfhCRW7kH4pYJn+WSLZlhwBOMd+xEPaYmQsCWQ0ZK8aZMbb3aet9vc8/3jLcO9A 97JA== 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=qu9DDpT+z8eAUNsJao2DfZZE0618H3cYZ4jtMTR/wqc=; b=MJvyOAbWklzBlSP1yL+MFoHN2WNo00QFB5UFVk0HtGiWwzCmFMzpqyT75Lxq56iniC YfzmsnGnTED9fC9FWZztB2LgYh4n6SgbpBR34qOpKRlasaLBoRQQOs3NqcfeZ6jgz6E9 mYl2GK+z7WBmoR8NcnRDVUEcKJMBfHDKh6CTEokFsTiiGR5IkFtDlHY12TWY8R5eEKL0 jcPWbOB76BVfjYsw/5mQFaLiv6WOjjc5Z01/h6csnL10n5NCHI1jm6MFvUKABYp2iVwF Xo3oMYuso8tSVb5/pHwELMZZILXXOansd84WSuHdT4RBLnxbnMjXRqRj4ge1K3X1qHpu 5nQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M1tMl04a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m8si19026597pls.115.2021.04.26.09.56.01; Mon, 26 Apr 2021 09:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M1tMl04a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234767AbhDZQyz (ORCPT + 99 others); Mon, 26 Apr 2021 12:54:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:58904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234333AbhDZQyz (ORCPT ); Mon, 26 Apr 2021 12:54:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A26BD610FC; Mon, 26 Apr 2021 16:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619456053; bh=/5nxe/CNEoSpv79yM3ZjDoG3vzUZrsto5hjWd0kskeM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M1tMl04aWQ/yNETBVoCZ1N9e8QmBje2w9kM8HXq6ANDgzc1XXZxB0wjdOpBzoKykG fPCJRSdMaHWlNIuDplcRH4z3xhu66WQ21zYq6n+e2dtSMMKu/L1qfIvzjAv+MJTGXO 75li+IFBMvKriV0m/qcvpxUJ/VALLAXSJ8OHWN4k= Date: Mon, 26 Apr 2021 18:54:10 +0200 From: Greg Kroah-Hartman To: Thomas Gleixner Cc: Bjorn Helgaas , linux-kernel@vger.kernel.org, Wenwen Wang , Bjorn Helgaas , Ingo Molnar Subject: Re: [PATCH 086/190] Revert "x86/PCI: Fix PCI IRQ routing table memory leak" Message-ID: References: <20210422050919.GA2913711@bjorn-Precision-5520> <87a6ppwcmc.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6ppwcmc.ffs@nanos.tec.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 23, 2021 at 11:53:31AM +0200, Thomas Gleixner wrote: > On Thu, Apr 22 2021 at 00:09, Bjorn Helgaas wrote: > > On Wed, Apr 21, 2021 at 02:59:21PM +0200, Greg Kroah-Hartman wrote: > > I would prefer that you not apply this revert. > > > > Prior to ea094d53580f ("x86/PCI: Fix PCI IRQ routing table memory > > leak"), we had essentially this: > > > > pcibios_irq_init() > > pirq_table = pcibios_get_irq_routing_table(); # kmallocs > > if (pirq_table) { > > if (io_apic_assign_pci_irqs) > > pirq_table = NULL; > > } > > > > So if we called pcibios_get_irq_routing_table(), we kmalloced some > > space and then (if io_apic_assign_pci_irqs) threw away the pointer, > > which leaks the pointer as the commit log says. > > > > After ea094d53580f, we have: > > > > pcibios_irq_init() > > rtable = NULL; > > pirq_table = pcibios_get_irq_routing_table(); # kmallocs > > rtable = pirq_table; > > if (pirq_table) { > > if (io_apic_assign_pci_irqs) { > > kfree(rtable); > > pirq_table = NULL; > > } > > } > > > > which seems right to me. > > It is correct. Thanks for the review, I'll go drop this revert. greg k-h