From: Suravee.Suthikulpanit@amd.com (Suravee Suthikulpanit)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] irqdomain: Fix NULL pointer dererence in irq_domain_free_irqs_parent
Date: Thu, 20 Nov 2014 20:08:14 -0600 [thread overview]
Message-ID: <546E9E8E.5000303@amd.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1411210219370.6439@nanos>
On 11/20/2014 07:32 PM, Thomas Gleixner wrote:
> On Thu, 20 Nov 2014, suravee.suthikulpanit at amd.com wrote:
>> This patch checks if the parent domain is NULL before recursively freeing
>> irqs in the parent domains.
>
> Which is nonsense, because if the thing has not been allocated in the
> first place, then it cannot explode in the free path magically, except
> there is a missing check in the allocation path error handling.
>
> And that's obviously not the case simply because this originates from:
>> [<fffffe0000449278>] pci_disable_msix+0x40/0x50
>
Thomas,
In this case, I have the following irq domain hierarchy:
[GIC] -- [GICv2m] -- [MSI]
which recursively calling the freeing function:
In GIC domain, it currently defines the struct irq_domain_ops.free() with :
--> irq_domain_free_irqs_top()
|--> irq_domain_free_irqs_common()
|--> irq_domain_free_irq_parent()
|--> irq_domain_free_irqs_recursive()
and there is no check before passing the NULL domain->parent into the
irq_domain_free_irqs_recursive(), which causes the error.
Since the GIC is the top most domain, it does not have parent domain.
So, I'm not sure what is missing from the allocation path error
handling, as you mentioned.
Thanks,
Suravee
next prev parent reply other threads:[~2014-11-21 2:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 1:02 [PATCH] irqdomain: Fix NULL pointer dererence in irq_domain_free_irqs_parent suravee.suthikulpanit at amd.com
2014-11-21 1:32 ` Thomas Gleixner
2014-11-21 2:08 ` Suravee Suthikulpanit [this message]
2014-11-21 2:49 ` Jiang Liu
2014-11-21 3:06 ` Suravee Suthikulpanit
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=546E9E8E.5000303@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).