[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250807181120.GA57051@bhelgaas>
Date: Thu, 7 Aug 2025 13:11:20 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Nam Cao <namcao@...utronix.de>
Cc: Nirmal Patel <nirmal.patel@...ux.intel.com>,
Jonathan Derrick <jonathan.derrick@...ux.dev>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kwilczynski@...nel.org>,
Manivannan Sadhasivam <mani@...nel.org>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Kenneth Crudup <kenny@...ix.com>,
Ammar Faizi <ammarfaizi2@...weeb.org>
Subject: Re: [PATCH v2] PCI: vmd: Fix wrong kfree() in vmd_msi_free()
On Thu, Aug 07, 2025 at 07:43:17PM +0200, Nam Cao wrote:
> Bjorn Helgaas <helgaas@...nel.org> writes:
> > On Thu, Aug 07, 2025 at 10:10:51AM +0200, Nam Cao wrote:
> >> vmd_msi_alloc() allocates struct vmd_irq and stashes it into
> >> irq_data->chip_data associated with the VMD's interrupt domain.
> >> vmd_msi_free() extracts the pointer by calling irq_get_chip_data() and
> >> frees it.
> >>
> >> irq_get_chip_data() returns the chip_data associated with the top interrupt
> >> domain. This worked in the past, because VMD's interrupt domain was the top
> >> domain.
> >>
> >> But since commit d7d8ab87e3e7 ("PCI: vmd: Switch to
> >> msi_create_parent_irq_domain()") changed the interrupt domain hierarchy,
> >> VMD's interrupt domain is not the top domain anymore. irq_get_chip_data()
> >> now returns the chip_data at the MSI devices' interrupt domains. It is
> >> therefore broken for vmd_msi_free() to kfree() this chip_data.
> >>
> >> Fix this issue, correctly extract the chip_data associated with the VMD's
> >> interrupt domain.
> ...
> >
> > Applied to pci/for-linus for v6.17, thanks!
> >
> > I assume you checked the other msi_create_parent_irq_domain() changes
> > for similar problems?
>
> Not before you reminded me :(
>
> But yes, none of the similar PCI patches has the same problem.
Great, thanks for checking! I'll try to get this in before v6.17-rc1
since many people will start using that.
Bjorn
Powered by blists - more mailing lists