From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756926Ab1LNP3j (ORCPT ); Wed, 14 Dec 2011 10:29:39 -0500 Received: from mail-yw0-f46.google.com ([209.85.213.46]:58744 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755610Ab1LNP30 (ORCPT ); Wed, 14 Dec 2011 10:29:26 -0500 From: Rob Herring To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org Cc: Grant Likely , shawn.guo@freescale.com, Kukjin Kim , Kevin Hilman , Tony Lindgren , Barry Song , Linus Walleij , Rob Herring , Thomas Gleixner Subject: [PATCH 2/9] irq: check domain hwirq range for DT translate Date: Wed, 14 Dec 2011 09:28:51 -0600 Message-Id: <1323876538-20406-3-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323876538-20406-1-git-send-email-robherring2@gmail.com> References: <1323876538-20406-1-git-send-email-robherring2@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring A DT node may have more than 1 domain associated with it, so make sure the hwirq number is within range when doing DT translation. Signed-off-by: Rob Herring Cc: Thomas Gleixner --- kernel/irq/irqdomain.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 200ce83..ae6441e 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -135,6 +135,9 @@ int irq_domain_simple_dt_translate(struct irq_domain *d, return -EINVAL; if (intsize < 1) return -EINVAL; + if ((intspec[0] < d->hwirq_base) || + (intspec[0] >= d->hwirq_base + d->nr_irq)) + return -EINVAL; *out_hwirq = intspec[0]; *out_type = IRQ_TYPE_NONE; -- 1.7.5.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: [PATCH 2/9] irq: check domain hwirq range for DT translate Date: Wed, 14 Dec 2011 09:28:51 -0600 Message-ID: <1323876538-20406-3-git-send-email-robherring2@gmail.com> References: <1323876538-20406-1-git-send-email-robherring2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1323876538-20406-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Cc: Kevin Hilman , Kukjin Kim , Tony Lindgren , Linus Walleij , Rob Herring , Barry Song , Thomas Gleixner List-Id: devicetree@vger.kernel.org From: Rob Herring A DT node may have more than 1 domain associated with it, so make sure the hwirq number is within range when doing DT translation. Signed-off-by: Rob Herring Cc: Thomas Gleixner --- kernel/irq/irqdomain.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 200ce83..ae6441e 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -135,6 +135,9 @@ int irq_domain_simple_dt_translate(struct irq_domain *d, return -EINVAL; if (intsize < 1) return -EINVAL; + if ((intspec[0] < d->hwirq_base) || + (intspec[0] >= d->hwirq_base + d->nr_irq)) + return -EINVAL; *out_hwirq = intspec[0]; *out_type = IRQ_TYPE_NONE; -- 1.7.5.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: robherring2@gmail.com (Rob Herring) Date: Wed, 14 Dec 2011 09:28:51 -0600 Subject: [PATCH 2/9] irq: check domain hwirq range for DT translate In-Reply-To: <1323876538-20406-1-git-send-email-robherring2@gmail.com> References: <1323876538-20406-1-git-send-email-robherring2@gmail.com> Message-ID: <1323876538-20406-3-git-send-email-robherring2@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org From: Rob Herring A DT node may have more than 1 domain associated with it, so make sure the hwirq number is within range when doing DT translation. Signed-off-by: Rob Herring Cc: Thomas Gleixner --- kernel/irq/irqdomain.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 200ce83..ae6441e 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -135,6 +135,9 @@ int irq_domain_simple_dt_translate(struct irq_domain *d, return -EINVAL; if (intsize < 1) return -EINVAL; + if ((intspec[0] < d->hwirq_base) || + (intspec[0] >= d->hwirq_base + d->nr_irq)) + return -EINVAL; *out_hwirq = intspec[0]; *out_type = IRQ_TYPE_NONE; -- 1.7.5.4