Skip to content

irqchip/gic-v3: Memory-safety fixes on the probe paths

Fuad Tabba linux-arm-kernel lkml 2 versions – Applied

Status from this message: The following commit has been merged into the irq/drivers branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesApplied
  2. v13 patches 2 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3irqchip/gic-v3-its: Don't free a vPE table shared with another ITSdrivers/irqchip/irq-gic-v3-its.c+5 -10 replies
2/3irqchip/gic-v3-its: Don't free the tables of an enabled ITSdrivers/irqchip/irq-gic-v3-its.c+6 -40 replies
3/3irqchip/gic-v3: Don't register a redistributor that was never counteddrivers/irqchip/irq-gic-v3.c+11 -00 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMarc Zyngier
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] irqchip/gic-v3: Memory-safety fixes on the probe paths

Hi folks,

Changes since v1 [1]:
- Patch 3 marks the skipped CPU in broken_rdists, so it's kept offline. (Marc, sashiko)

Three probe-time bugs in the GICv3 drivers. The kernel keeps running after each of them, so the memory involved is live rather than on the way to a reset.

The first two free memory an enabled ITS still points at. Boot carries on because its_init() discards a failed probe and gic_init_bases() discards what its_init() returns. The third is a write past the end of redist_regs[] for an enabled GICC with a zero GICR base, on a MADT with no GICR entries. fa2dabe57220e's commit message says such tables exist, and I haven't seen one.

Based on Linux 7.3-rc4 (93f51579e7df2).

Cheers,
/fuad

[1] https://lore.kernel.org/all/[email protected]/

Fuad Tabba (3):
irqchip/gic-v3-its: Don't free a vPE table shared with another ITS irqchip/gic-v3-its: Don't free the tables of an enabled ITS irqchip/gic-v3: Don't register a redistributor that was never counted

 drivers/irqchip/irq-gic-v3-its.c | 16 +++++++++++-----
 drivers/irqchip/irq-gic-v3.c     | 11 +++++++++++
 2 files changed, 22 insertions(+), 5 deletions(-)

base-commit: 93f51579e7df248780214094418f205253383cc5

Signature · 1 line
2.39.5