lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877bzfck9a.ffs@tglx>
Date: Thu, 07 Aug 2025 15:51:45 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Nam Cao <namcao@...utronix.de>, 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>, linux-pci@...r.kernel.org,
 linux-kernel@...r.kernel.org
Cc: Nam Cao <namcao@...utronix.de>, 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 10:10, 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.
>
> Fixes: d7d8ab87e3e7 ("PCI: vmd: Switch to msi_create_parent_irq_domain()")
> Reported-by: Kenneth Crudup <kenny@...ix.com>
> Closes: https://lore.kernel.org/linux-pci/dfa40e48-8840-4e61-9fda-25cdb3ad81c1@panix.com/
> Reported-by: Ammar Faizi <ammarfaizi2@...weeb.org>
> Closes: https://lore.kernel.org/linux-pci/ed53280ed15d1140700b96cca2734bf327ee92539e5eb68e80f5bbbf0f01@linux.gnuweeb.org/
> Tested-by: Ammar Faizi <ammarfaizi2@...weeb.org>
> Tested-by: Kenneth Crudup <kenny@...ix.com>
> Signed-off-by: Nam Cao <namcao@...utronix.de>

Reviewed-by: Thomas Gleixner <tglx@...utronix.de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ