From nobody Mon Jun 8 21:46:14 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5374F3DFC67 for ; Tue, 26 May 2026 11:26:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779794784; cv=none; b=ox/MRYjgZKr10BgxhJqohRapzpkNjB+0DBT2kLh+XqWhNj+pOwhP00fw48HEkBajIpqDAyKIu9VmDEtKasHguhyeTKGMaTyT+ELhcrm/UBQikm4FS8V4zy67uEvHbAa/YA1i9SP6LAnnuLxnzaFVA7O2j+iDHG3i4majZ7136ME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779794784; c=relaxed/simple; bh=sW8JYvOqNtKo6BNSxgZqVZa9WkDsJeZRvFJrlanKlos=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=W31zTxbhGDl65tRG+iC1fdochH22g8eJTxdiT0TPTf2Rr3IxZakljGaelNyXoisy98/r5RySp+KPspW+q9d5mPtuJoGCn4N2RqzoOf/BMDzzoBrpmrEWOctxr7fQoiLed6cqwwruP/kuQA01Y5wstnYD1I+6XZhkieft1pjPGFg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--smostafa.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ehpOATKe; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--smostafa.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ehpOATKe" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4904ee02e72so27692925e9.1 for ; Tue, 26 May 2026 04:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779794782; x=1780399582; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=O7rx7KyPWyATkNYQBTFfTCI2vUcCFRxmTiO8Ep3+9hI=; b=ehpOATKe1L00AVUrNM4vUbAu+RZ0vQEqN8xn5RXw+eAn/P5Rs4oB6y3LoNul/oARqt 932pObEgka8MRQWLJYkQGRJkA5hmKJWdZnh1UG1jUHR6BPEliZuF58RVGCzBo5F5SXk5 IUVZGpI0UlNbhbjzw5gUf2BCJU4okOMHUU8cD0X7369TYT5bfhOFxvLkhgBOUS4UhUwx 7vfSnAbXI37ujrmeLMCTjrLV01s5f/KCIMc9m9WcqHuPdyIOic1NenH70Q/oSwSWVRm6 qDdius5veO7rbQFQfJNJOFwBaXdpz6mABjjrXmQDnnxto+/3nyYvZKgwFqNEn+IxVTCK gwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779794782; x=1780399582; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=O7rx7KyPWyATkNYQBTFfTCI2vUcCFRxmTiO8Ep3+9hI=; b=jmycwC11oOXCdpL1sS35HkwQlS86SWXhQ0rZDhA9QqiCdmgVJ0olxYa5zl/wq5+cWD WEgqXtH/EPbMpgMzCcbIfzOe5/Lzi4abbYys7vtXRdTo6WBU3+/XjB+aggiwSZAfGrzY 45swfI+CNrINB0L4kxw3VU/8I4sOD4al8Go7+rGxjep2lIWgqkO6OElB7Ka8mKE+yIYX YbCjmrMazq9SkjBaywiy3a5wLbV4bV6Q+zpNsIPUOg8O/2BSdSA5/FZ25oXmAHFnf/bf gxLEZ8uWvtmtq/Gxe+z58QdPfsHIbAEFWPzi7Kz93yXc6yvmvanBVMiiwGDNWpy6FGji 8KsQ== X-Forwarded-Encrypted: i=1; AFNElJ9qHT+D9ZyLxnRfcmQlqFRY83HE+JdrVZ4S9tJUt85bWt85JRlIHJNrVmX1UTQwCS4Cl4mSRkx575cMup4=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/6r2yUINzhOEtyXry/kbxGKvzJZpE5aD2rblPhBmLo/TQA1Ve Fzi/Z1xViHP8LK08OY4CVJwaqViUoyKZvfoj40K24pqyWXMP0BZcFDwRjSP7piu1G7ttf6//Voa AZcmCnWGjY1RXAw== X-Received: from wmco1.prod.google.com ([2002:a05:600c:a301:b0:490:6868:7565]) (user=smostafa job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:35c8:b0:490:45bb:8dd9 with SMTP id 5b1f17b1804b1-49045bb8efdmr318834875e9.8.1779794781467; Tue, 26 May 2026 04:26:21 -0700 (PDT) Date: Tue, 26 May 2026 11:26:18 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.54.0.746.g67dd491aae-goog Message-ID: <20260526112618.3629321-1-smostafa@google.com> Subject: [PATCH v2] irqchip/gic-v4: Harden against bogus command line From: Mostafa Saleh To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: maz@kernel.org, tglx@kernel.org, Mostafa Saleh Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When accidentally setting =E2=80=9Ckvm-arm.vgic_v4_enable=3D1=E2=80=9D on t= he wrong setup that has no MSI controller device tree node (it exists but not used) and GICv4, it caused a panic as =E2=80=9Cgic_domain=E2=80=9D is N= ULL and the kernel attempted to access its ops. Originally, I hit this on an older kernel, but was able to reproduce it on upstream with Qemu by hacking this unreasonable setup. [ 33.145536] Unable to handle kernel NULL pointer dereference at virtual = address 0000000000000028 [ 33.145658] Mem abort info: [ 33.145751] ESR =3D 0x0000000096000006 ... [ 33.154057] CPU: 1 UID: 0 PID: 295 Comm: lkvm-static Not tainted 7.1.0-r= c4-ge3f15ad3970e #5 PREEMPT [ 33.156922] Hardware name: linux,dummy-virt (DT) [ 33.158780] pstate: 81402005 (Nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE= =3D--) [ 33.160340] pc : __irq_domain_instantiate+0x1d4/0x578 [ 33.162602] lr : __irq_domain_instantiate+0x1cc/0x578 Set vLPI support to false at init time if the host has no ITS, so it propagates properly to kvm_vgic_global_state.has_gicv4. Suggested-by: Marc Zyngier Signed-off-by: Mostafa Saleh Acked-by: Marc Zyngier --- v2: Fix the issue at construction as Marc suggested. --- drivers/irqchip/irq-gic-v3-its.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-= its.c index 291d7668cc8d..d02cb9c17c0b 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -5837,6 +5837,7 @@ int __init its_init(struct fwnode_handle *handle, str= uct rdists *rdists, its_acpi_probe(); =20 if (list_empty(&its_nodes)) { + rdists->has_vlpis =3D false; pr_warn("ITS: No ITS available, not enabling LPIs\n"); return -ENXIO; } --=20 2.54.0.746.g67dd491aae-goog