Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Nam Cao <namcao@linutronix.de>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Michal Simek" <michal.simek@amd.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: xilinx: Fix NULL pointer dereference
Date: Mon, 11 Aug 2025 17:29:37 -0500	[thread overview]
Message-ID: <20250811222937.GA167215@bhelgaas> (raw)
In-Reply-To: <20250811054144.4049448-1-namcao@linutronix.de>

On Mon, Aug 11, 2025 at 07:41:44AM +0200, Nam Cao wrote:
> Commit f29861aa301c5 ("PCI: xilinx: Switch to
> msi_create_parent_irq_domain()") changed xilinx_pcie::msi_domain from child
> devices' interrupt domain into Xilinx AXI bridge's interrupt domain.
> 
> However, xilinx_pcie_intr_handler() wasn't changed and still reads Xilinx
> AXI bridge's interrupt domain from xilinx_pcie::msi_domain->parent. This
> pointer is NULL now.
> 
> Update xilinx_pcie_intr_handler() to read the correct interrupt domain
> pointer.
> 
> Fixes: f29861aa301c5 ("PCI: xilinx: Switch to msi_create_parent_irq_domain()")

Since this appeared in v6.17-rc1, I suppose this should be merged for
v6.17, right?  I provisionally put this on pci/for-linus for now.

What does this look like to a user?  I assume a NULL pointer
dereference in xilinx_pcie_intr_handler()?  Do you have a dmesg
snippet from hitting it?  It would be nice to include a couple lines
of that in the commit log to help users find this fix.

> Signed-off-by: Nam Cao <namcao@linutronix.de>
> ---
>  drivers/pci/controller/pcie-xilinx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c
> index f121836c3cf4..937ea6ae1ac4 100644
> --- a/drivers/pci/controller/pcie-xilinx.c
> +++ b/drivers/pci/controller/pcie-xilinx.c
> @@ -400,7 +400,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
>  		if (val & XILINX_PCIE_RPIFR1_MSI_INTR) {
>  			val = pcie_read(pcie, XILINX_PCIE_REG_RPIFR2) &
>  				XILINX_PCIE_RPIFR2_MSG_DATA;
> -			domain = pcie->msi_domain->parent;
> +			domain = pcie->msi_domain;
>  		} else {
>  			val = (val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
>  				XILINX_PCIE_RPIFR1_INTR_SHIFT;
> -- 
> 2.39.5
> 


  reply	other threads:[~2025-08-11 22:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11  5:41 [PATCH] PCI: xilinx: Fix NULL pointer dereference Nam Cao
2025-08-11 22:29 ` Bjorn Helgaas [this message]
2025-08-12  6:10   ` Nam Cao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250811222937.GA167215@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=namcao@linutronix.de \
    --cc=robh@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox