[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YIbwMhw2sGRpNenN@kroah.com>
Date: Mon, 26 Apr 2021 18:54:10 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Bjorn Helgaas <helgaas@...nel.org>, linux-kernel@...r.kernel.org,
Wenwen Wang <wang6495@....edu>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 086/190] Revert "x86/PCI: Fix PCI IRQ routing table
memory leak"
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
Powered by blists - more mailing lists