linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Punit Agrawal <punit.agrawal@arm.com>,
	tglx@linutronix.de, jiang.liu@linux.intel.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] genirq: Use firmware identifier while adding domain
Date: Mon, 5 Sep 2016 15:30:44 +0100	[thread overview]
Message-ID: <57CD8194.2090306@arm.com> (raw)
In-Reply-To: <1464699409-23113-2-git-send-email-punit.agrawal@arm.com>

On 31/05/16 13:56, Punit Agrawal wrote:
> Use the firmware provided identifier for the domain name.
> 
> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
> ---
>  kernel/irq/irqdomain.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
> index 1fe2fea..3af09e1 100644
> --- a/kernel/irq/irqdomain.c
> +++ b/kernel/irq/irqdomain.c
> @@ -114,6 +114,10 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
>  	domain->hwirq_max = hwirq_max;
>  	domain->revmap_size = size;
>  	domain->revmap_direct_max_irq = direct_max;
> +	if (is_fwnode_irqchip(fwnode))
> +		domain->name = container_of(fwnode, struct irqchip_fwid, fwnode)->name;

So this thing worries me to no end. Look at the way irqchip_fwid is
constructed:

	name = kasprintf(GFP_KERNEL, "irqchip@%p", data);

You'd end-up disclosing a kernel address, which is not a very good idea.

> +	else
> +		domain->name = of_node_full_name(of_node);

And what if the node gets pruned (as it can happen on OpenFirmware
implementations)?

>  	irq_domain_check_hierarchy(domain);
>  
>  	mutex_lock(&irq_domain_mutex);
> 

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2016-09-05 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 12:56 [PATCH 1/2] genirq: Update stale comment for __irq_domain_add Punit Agrawal
2016-05-31 12:56 ` [PATCH 2/2] genirq: Use firmware identifier while adding domain Punit Agrawal
2016-09-05 14:30   ` Marc Zyngier [this message]
2016-09-05 14:30 ` [PATCH 1/2] genirq: Update stale comment for __irq_domain_add Marc Zyngier
2016-09-05 15:16 ` [tip:irq/core] " tip-bot for Punit Agrawal

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=57CD8194.2090306@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=punit.agrawal@arm.com \
    --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;
as well as URLs for NNTP newsgroup(s).