mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Fuad Tabba" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Fuad Tabba <fuad.tabba@linux.dev>,
	Thomas Gleixner <tglx@kernel.org>, Marc Zyngier <maz@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/drivers] irqchip/gic-v3-its: Don't free a vPE table shared with another ITS
Date: Thu, 15 Oct 2026 09:54:41 -0000	[thread overview]
Message-ID: <179205808103.2666988.15430588161153938600.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260925085000.753400-2-fuad.tabba@linux.dev>

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     496375c937cc76d36bacaf62b4d599c3ee41115d
Gitweb:        https://git.kernel.org/tip/496375c937cc76d36bacaf62b4d599c3ee41115d
Author:        Fuad Tabba <fuad.tabba@linux.dev>
AuthorDate:    Fri, 25 Sep 2026 09:49:58 +01:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Thu, 15 Oct 2026 11:50:48 +02:00

irqchip/gic-v3-its: Don't free a vPE table shared with another ITS

On GICv4.1, its_alloc_tables() copies a sibling's vPE table baser
rather than allocating one, but its_free_tables() frees it like the
rest. A probe failure on the copying ITS then frees pages the enabled
sibling still points GITS_BASER2 at, and the kernel comes up running
on that sibling.

Mark a shared table so its_free_tables() skips it.

Fixes: 5e5168461c22c ("irqchip/gic-v4.1: VPE table (aka GICR_VPROPBASER) allocation")
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://patch.msgid.link/20260925085000.753400-2-fuad.tabba@linux.dev
---
 drivers/irqchip/irq-gic-v3-its.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 872d342..259ec0c 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -87,6 +87,8 @@ struct its_baser {
 	u64		val;
 	u32		order;
 	u32		psz;
+	/* Inherited from a sibling ITS, not freed here */
+	bool		shared;
 };
 
 struct its_device;
@@ -2605,7 +2607,8 @@ static void its_free_tables(struct its_node *its)
 
 	for (i = 0; i < GITS_BASER_NR_REGS; i++) {
 		if (its->tables[i].base) {
-			its_free_pages(its->tables[i].base, its->tables[i].order);
+			if (!its->tables[i].shared)
+				its_free_pages(its->tables[i].base, its->tables[i].order);
 			its->tables[i].base = NULL;
 		}
 	}
@@ -2704,6 +2707,7 @@ static int its_alloc_tables(struct its_node *its)
 				WARN_ON(i != 2);
 				if ((sibling = find_sibling_its(its))) {
 					*baser = sibling->tables[2];
+					baser->shared = true;
 					its_write_baser(its, baser, baser->val);
 					continue;
 				}

  reply	other threads:[~2026-10-15  9:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  8:49 [PATCH v2 0/3] irqchip/gic-v3: Memory-safety fixes on the probe paths Fuad Tabba
2026-09-25  8:49 ` [PATCH v2 1/3] irqchip/gic-v3-its: Don't free a vPE table shared with another ITS Fuad Tabba
2026-10-15  9:54   ` tip-bot2 for Fuad Tabba [this message]
2026-10-15 10:00   ` [tip: irq/drivers] " tip-bot2 for Fuad Tabba
2026-09-25  8:49 ` [PATCH v2 2/3] irqchip/gic-v3-its: Don't free the tables of an enabled ITS Fuad Tabba
2026-10-15  9:54   ` [tip: irq/drivers] " tip-bot2 for Fuad Tabba
2026-10-15 10:00   ` tip-bot2 for Fuad Tabba
2026-09-25  8:50 ` [PATCH v2 3/3] irqchip/gic-v3: Don't register a redistributor that was never counted Fuad Tabba
2026-10-15  9:54   ` [tip: irq/drivers] " tip-bot2 for Fuad Tabba
2026-10-15 10:00   ` tip-bot2 for Fuad Tabba
2026-09-27  9:23 ` [PATCH v2 0/3] irqchip/gic-v3: Memory-safety fixes on the probe paths Marc Zyngier
2026-10-07  3:22 ` Fuad Tabba
2026-10-10 19:44   ` Thomas Gleixner

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=179205808103.2666988.15430588161153938600.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=fuad.tabba@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®