From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756863AbdJKJmK (ORCPT ); Wed, 11 Oct 2017 05:42:10 -0400 Received: from foss.arm.com ([217.140.101.70]:57268 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756759AbdJKJmH (ORCPT ); Wed, 11 Oct 2017 05:42:07 -0400 From: Punit Agrawal To: linux-kernel@vger.kernel.org Cc: Punit Agrawal , marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/3] GICv3: Bounds check redistributor accesses Date: Wed, 11 Oct 2017 10:41:45 +0100 Message-Id: <20171011094148.15674-1-punit.agrawal@arm.com> X-Mailer: git-send-email 2.14.1 X-ARM-No-Footer: FoSSMail Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, While bringing up linux on a platform with GICv3, I ran into a kernel crash (data abort) due to incorrectly sized GIC redistributor region in the device tree. Even though the firmware is expected to provide incorrect information, crashing on the kernel's part when that is not the case is also not ideal. This series adds bounds checking to redistributor accesses. This prevents the crash. But we can do one better - when the redistributor region has been exhausted without encountering the last record the user is warned of this situation. This can be useful for developers during board bring-up. Patch 3 is where the bulk of the checking is introduced. The patch is a bit invasive but there doesn't seem to be a nicer way to isolate the change given layout of the redistributor. Feedback welcome. Thanks, Punit Punit Agrawal (3): irqchip/gic-v3: Use resource structure to store redistributor regions irqchip/gic-v3: Report firmwware provided address in case of error irqchip/gic-v3: Bounds check redistributor accesses drivers/irqchip/irq-gic-v3.c | 80 +++++++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 19 deletions(-) -- 2.14.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: punit.agrawal@arm.com (Punit Agrawal) Date: Wed, 11 Oct 2017 10:41:45 +0100 Subject: [PATCH 0/3] GICv3: Bounds check redistributor accesses Message-ID: <20171011094148.15674-1-punit.agrawal@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, While bringing up linux on a platform with GICv3, I ran into a kernel crash (data abort) due to incorrectly sized GIC redistributor region in the device tree. Even though the firmware is expected to provide incorrect information, crashing on the kernel's part when that is not the case is also not ideal. This series adds bounds checking to redistributor accesses. This prevents the crash. But we can do one better - when the redistributor region has been exhausted without encountering the last record the user is warned of this situation. This can be useful for developers during board bring-up. Patch 3 is where the bulk of the checking is introduced. The patch is a bit invasive but there doesn't seem to be a nicer way to isolate the change given layout of the redistributor. Feedback welcome. Thanks, Punit Punit Agrawal (3): irqchip/gic-v3: Use resource structure to store redistributor regions irqchip/gic-v3: Report firmwware provided address in case of error irqchip/gic-v3: Bounds check redistributor accesses drivers/irqchip/irq-gic-v3.c | 80 +++++++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 19 deletions(-) -- 2.14.1