Page MenuHomeFreeBSD

D38305.id116147.diff
No OneTemporary

D38305.id116147.diff

diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -2,7 +2,7 @@
* Copyright (c) 2015-2016 Svatopluk Kraus
* Copyright (c) 2015-2016 Michal Meloun
* All rights reserved.
- * Copyright © 2023 Elliott Mitchell
+ * Copyright © 2022,2023 Elliott Mitchell
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -150,6 +150,7 @@
u_long *intrcnt;
char *intrnames;
u_int intrcnt_index;
+static u_int intrcnt_count;
static struct intr_irqsrc *intr_map_get_isrc(u_int res_id);
static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc);
@@ -163,7 +164,6 @@
static void
intr_irq_init(void *dummy __unused)
{
- u_int intrcnt_count;
SLIST_INIT(&pic_list);
mtx_init(&pic_list_lock, "intr pic list", NULL, MTX_DEF);
@@ -207,6 +207,9 @@
char str[INTRNAME_LEN];
index = atomic_fetchadd_int(&intrcnt_index, MAXCPU);
+ if (index >= intrcnt_count)
+ panic("overflowed IPI interrupt name table size (index=%u)",
+ index);
for (i = 0; i < MAXCPU; i++) {
snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name);
intrcnt_setname(str, index + i);

File Metadata

Mime Type
text/plain
Expires
Tue, May 19, 4:59 AM (6 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33292821
Default Alt Text
D38305.id116147.diff (1 KB)

Event Timeline