public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: Thomas Gleixner <tglx@linutronix.de>, Bert Karwatzki <spasswolf@web.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-kernel@vger.kernel.org,
	James.Bottomley@HansenPartnership.com,
	Jonathan.Cameron@huawei.com, allenbh@gmail.com, d-gole@ti.com,
	dave.jiang@intel.com, haiyangz@microsoft.com, jdmason@kudzu.us,
	kristo@kernel.org, linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org,
	logang@deltatee.com, manivannan.sadhasivam@linaro.org,
	martin.petersen@oracle.com, maz@kernel.org, mhklinux@outlook.com,
	nm@ti.com, ntb@lists.linux.dev, peterz@infradead.org,
	ssantosh@kernel.org, wei.huang2@amd.com, wei.liu@kernel.org,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	venkat88@linux.ibm.com
Subject: Re: commit 7b025f3f85ed causes NULL pointer dereference
Date: Wed, 9 Apr 2025 20:52:08 +0530	[thread overview]
Message-ID: <105f1b15-9536-4847-a3c5-8ca0993cfa35@linux.ibm.com> (raw)
In-Reply-To: <87a58qv0tn.ffs@tglx>


On 09/04/25 2:16 am, Thomas Gleixner wrote:
> On Tue, Apr 08 2025 at 18:20, Bert Karwatzki wrote:
>> Am Dienstag, dem 08.04.2025 um 17:29 +0200 schrieb Thomas Gleixner:
>>>> Can you please decode the lines please via:
>>>>
>>>>      scripts/faddr2line vmlinux msi_domain_first_desc+0x4/0x30
>>>>      scripts/faddr2line vmlinux msix_setup_interrupts+0x23b/0x280
>> I had to recompile with CONFIG_DEBUG_INFO=Y, and reran the test, the calltrace
>> is identical.
>>
>> $ scripts/faddr2line vmlinux msi_domain_first_desc+0x4/0x30
>> msi_domain_first_desc+0x4/0x30:
>> msi_domain_first_desc at kernel/irq/msi.c:400
>>
>> So it seems msi_domain_first_desc() is called with dev = NULL.


This issue is seen on IBM Power9 server also. Bisection is pointing to 
7b025f3f85ed4283d5a414371bb2ffd38d19033f as first bad commit.

I applied this patch on top of 20250409 and it fixes the issue.


> Yup
>
>> $ scripts/faddr2line vmlinux msix_setup_interrupts+0x23b/0x280
>> msix_setup_interrupts+0x23b/0x280:
>> msix_update_entries at drivers/pci/msi/msi.c:647 (discriminator 1)
> Aaarg. The patch below should fix that.
>
> Thanks,
>
>          tglx
> ---
> diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
> index 4027abcafe7a..77cc27e45b66 100644
> --- a/drivers/pci/msi/msi.c
> +++ b/drivers/pci/msi/msi.c
> @@ -680,8 +680,8 @@ static int __msix_setup_interrupts(struct pci_dev *__dev, struct msix_entry *ent
>   	if (ret)
>   		return ret;
>   
> -	retain_ptr(dev);
>   	msix_update_entries(dev, entries);
> +	retain_ptr(dev);
>   	return 0;
>   }
>   

Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>

Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>


Regards,

Venkat.


  parent reply	other threads:[~2025-04-09 15:23 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 10:56 [patch V4 00/14] genirq/msi: Spring cleaning Thomas Gleixner
2025-03-19 10:56 ` [patch V4 01/14] cleanup: Provide retain_ptr() Thomas Gleixner
2025-03-19 20:15   ` James Bottomley
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` [tip: irq/msi] cleanup: Provide retain_and_null_ptr() tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 02/14] genirq/msi: Use lock guards for MSI descriptor locking Thomas Gleixner
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 03/14] soc: ti: ti_sci_inta_msi: Switch MSI descriptor locking to guard() Thomas Gleixner
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 04/14] NTB/msi: Switch MSI descriptor locking to lock guard() Thomas Gleixner
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 05/14] PCI/MSI: Use guard(msi_desc_lock) where applicable Thomas Gleixner
2025-03-19 17:08   ` Bjorn Helgaas
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 06/14] PCI/MSI: Set pci_dev::msi_enabled late Thomas Gleixner
2025-03-19 17:08   ` Bjorn Helgaas
2025-04-07 14:31   ` [tip: irq/msi] PCI/MSI: Set pci_dev:: Msi_enabled late tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 07/14] PCI/MSI: Use __free() for affinity masks Thomas Gleixner
2025-03-19 17:09   ` Bjorn Helgaas
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 08/14] PCI/MSI: Switch msi_capability_init() to guard(msi_desc_lock) Thomas Gleixner
2025-03-19 17:09   ` Bjorn Helgaas
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 09/14] PCI/MSI: Switch msix_capability_init() " Thomas Gleixner
2025-03-19 17:09   ` Bjorn Helgaas
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-08 12:04   ` commit 7b025f3f85ed causes NULL pointer dereference Bert Karwatzki
2025-04-08 15:09     ` Thomas Gleixner
2025-04-08 15:29       ` Thomas Gleixner
2025-04-08 16:20         ` Bert Karwatzki
2025-04-08 20:22           ` Klara Modin
2025-04-08 20:46           ` Thomas Gleixner
2025-04-09 11:44             ` Aithal, Srikanth
2025-04-09 11:49             ` Andy Shevchenko
2025-04-09 12:49             ` James Bottomley
2025-04-09 18:38               ` Thomas Gleixner
2025-04-09 15:22             ` Venkat Rao Bagalkote [this message]
2025-04-09 18:29             ` Borislav Petkov
2025-04-09 18:54   ` [tip: irq/msi] PCI/MSI: Switch msix_capability_init() to guard(msi_desc_lock) tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 10/14] PCI: hv: Switch MSI descriptor locking to guard() Thomas Gleixner
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:56 ` [patch V4 11/14] PCI/MSI: Provide a sane mechanism for TPH Thomas Gleixner
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-06-17 23:22   ` [patch V4 11/14] " Bjorn Helgaas
2025-06-17 23:25     ` Bjorn Helgaas
2025-03-19 10:56 ` [patch V4 12/14] PCI/TPH: Replace the broken MSI-X control word update Thomas Gleixner
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:57 ` [patch V4 13/14] scsi: ufs: qcom: Remove the MSI descriptor abuse Thomas Gleixner
2025-03-19 20:40   ` James Bottomley
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner
2025-03-19 10:57 ` [patch V4 14/14] genirq/msi: Rename msi_[un]lock_descs() Thomas Gleixner
2025-04-07 14:31   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2025-04-09 18:54   ` tip-bot2 for Thomas Gleixner

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=105f1b15-9536-4847-a3c5-8ca0993cfa35@linux.ibm.com \
    --to=venkat88@linux.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=allenbh@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=d-gole@ti.com \
    --cc=dave.jiang@intel.com \
    --cc=haiyangz@microsoft.com \
    --cc=jdmason@kudzu.us \
    --cc=kristo@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=maddy@linux.ibm.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=maz@kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=nm@ti.com \
    --cc=ntb@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=spasswolf@web.de \
    --cc=ssantosh@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wei.huang2@amd.com \
    --cc=wei.liu@kernel.org \
    /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