Skip to content

GICv3: Bounds check redistributor accesses

Punit Agrawal linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3irqchip/gic-v3: Use resource structure to store redistributor regionsdrivers/irqchip/irq-gic-v3.c+19 -100 replies
2/3irqchip/gic-v3: Report firmwware provided address in case of errordrivers/irqchip/irq-gic-v3.c+2 -10 replies
3/3irqchip/gic-v3: Bounds check redistributor accessesdrivers/irqchip/irq-gic-v3.c+40 -84 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] GICv3: Bounds check redistributor accesses

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(-)
Signature · 1 line
2.14.1