git: 62a81003536e - stable/15 - clapic_handle_intr: KASSERT isrc != NULL
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Apr 2026 15:04:22 UTC
The branch stable/15 has been updated by cperciva:
URL: https://cgit.FreeBSD.org/src/commit/?id=62a81003536ee6f06707b460e79cae348a7a71d2
commit 62a81003536ee6f06707b460e79cae348a7a71d2
Author: Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2026-03-14 01:03:44 +0000
Commit: Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-04-16 15:03:58 +0000
clapic_handle_intr: KASSERT isrc != NULL
If an interrupt arrives at a CPU which isn't expecting that particular
vector, intr_lookup_source will return an isrc of NULL and we'll panic
when intr_execute_handlers increments *isrc->is_count.
Place a KASSERT a few nanoseconds earlier in order to leave some more
breadcrumbs for the next person to trip over this behaviour.
Tested on: EC2 r8i.96xlarge
MFC after: 3 weeks
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D55851
(cherry picked from commit f350063a251c9da0c5ce437eb4c44a2d716b673e)
---
sys/x86/x86/local_apic.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 54026f83dc15..ed9f985dafd5 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -1426,6 +1426,9 @@ lapic_handle_intr(int vector, struct trapframe *frame)
isrc = intr_lookup_source(apic_idt_to_irq(PCPU_GET(apic_id),
vector));
+ KASSERT(isrc != NULL,
+ ("lapic_handle_intr: vector %d unrecognized at lapic %u",
+ vector, PCPU_GET(apic_id)));
intr_execute_handlers(isrc, frame);
}