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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <96a6e4a3-c89c-4446-8c3f-a0f173aed26a@163.com>
Date: Thu, 1 May 2025 09:51:07 +0800
From: Hans Zhang <18255117159@....com>
To: Andrew Jones <ajones@...tanamicro.com>, linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de
Subject: Re: [PATCH] genirq/msi: Fix MSI domain debugfs show



On 2025/4/30 20:48, Andrew Jones wrote:
> irq_domain_debug_show_one() calls the irqdomain's debug_show() with
> a non-null domain pointer and a null irqdata pointer
> (irq_debug_show_data() calls debug_show() with those the other way
> around). Ensure we have a non-null irqdata pointer in
> msi_domain_debug_show() before dereferencing it.
> 
> Fixes: 01499ae673dc ("genirq/msi: Expose MSI message data in debugfs")
> Signed-off-by: Andrew Jones <ajones@...tanamicro.com>
> ---
>   kernel/irq/msi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
> index 5c8d43cdb0a3..c05ba7ca00fa 100644
> --- a/kernel/irq/msi.c
> +++ b/kernel/irq/msi.c
> @@ -761,7 +761,7 @@ static int msi_domain_translate(struct irq_domain *domain, struct irq_fwspec *fw
>   static void msi_domain_debug_show(struct seq_file *m, struct irq_domain *d,
>   				  struct irq_data *irqd, int ind)
>   {
> -	struct msi_desc *desc = irq_data_get_msi_desc(irqd);
> +	struct msi_desc *desc = irqd ? irq_data_get_msi_desc(irqd) : NULL;
>   

Hi Andrew,

I think irqd will never be NULL.


static int irq_debug_show(struct seq_file *m, void *p)
   irq_debug_show_data(m, data, 0);
     if (data->domain && data->domain->ops && data->domain->ops->debug_show)
       data->domain->ops->debug_show(m, NULL, data, ind + 1);
         msi_domain_debug_show



static int irq_debug_show(struct seq_file *m, void *p)
{
	struct irq_desc *desc = m->private;
	struct irq_data *data;

	raw_spin_lock_irq(&desc->lock);
	data = irq_desc_get_irq_data(desc);

	If it needs to be judged as NULL, should it also be here?



static void irq_domain_debug_show_one(struct seq_file *m, struct 
irq_domain *d, int ind)
   if (d->ops && d->ops->debug_show)	// d->ops->debug_show is NULL, not 
irq_debug_show.


If I'm wrong, please correct me.

Best regards,
Hans

>   	if (!desc)
>   		return;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ