summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2014-07-17 12:56:07 +0000
committerdlg <dlg@openbsd.org>2014-07-17 12:56:07 +0000
commit5a571b9eb7f276474a95f9ee94430d99e9813e6b (patch)
treeb42d3e1a03935a40462845c845f05c77122b9f67
parentimmidiatelly -> immediately (diff)
downloadwireguard-openbsd-5a571b9eb7f276474a95f9ee94430d99e9813e6b.tar.xz
wireguard-openbsd-5a571b9eb7f276474a95f9ee94430d99e9813e6b.zip
interrupt handlers established via the ioapic didnt get their
ih_flags set. ih_flags are used by the intr_handler() code to determine if the kernel lock should be taken or not. because the flags werent set, random memory was used instead which in turn meant you sometimes didnt have the biglock when running interrupt handlers which relied on it. races ahoy. this was found by jmatthew@ while helping me try to figure out why bnx was blowing up and causing double frees and use after frees. turns out bnx was the smoke for this fire. sorry it took so long. ok kettenis@ sthen@ sthen@ seems happy to have the i386 ports build machine working again.
-rw-r--r--sys/arch/i386/i386/ioapic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/ioapic.c b/sys/arch/i386/i386/ioapic.c
index ab58bbf2319..784933b42b7 100644
--- a/sys/arch/i386/i386/ioapic.c
+++ b/sys/arch/i386/i386/ioapic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioapic.c,v 1.31 2014/07/12 18:44:41 tedu Exp $ */
+/* $OpenBSD: ioapic.c,v 1.32 2014/07/17 12:56:07 dlg Exp $ */
/* $NetBSD: ioapic.c,v 1.7 2003/07/14 22:32:40 lukem Exp $ */
/*-
@@ -736,6 +736,7 @@ apic_intr_establish(int irq, int type, int level, int (*ih_fun)(void *),
ih->ih_arg = ih_arg;
ih->ih_next = NULL;
ih->ih_level = level;
+ ih->ih_flags = flags;
ih->ih_irq = irq;
evcount_attach(&ih->ih_count, ih_what, &pin->ip_vector);