Skip to content

Commit d35c4cf

Browse files
committed
sysctl: Panic on OID reuse
In CheriBSD we had a conflict in the KERN_PROC OID space and didn't notice for some time. Let's panic instead to make such conflicts easier to detect. Note that this doesn't affect conflicts arising from name collisions in OID_AUTO sysctls, which happen sometimes due to driver bugs. Reviewed by: brooks, kib, jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D49351
1 parent ee9ce10 commit d35c4cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sys/kern/kern_sysctl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ sysctl_register_oid(struct sysctl_oid *oidp)
516516
/* check for non-auto OID number collision */
517517
if (oidp->oid_number >= 0 && oidp->oid_number < CTL_AUTO_START &&
518518
oid_number >= CTL_AUTO_START) {
519-
printf("sysctl: OID number(%d) is already in use for '%s'\n",
519+
panic("sysctl: OID number(%d) is already in use for '%s'\n",
520520
oidp->oid_number, oidp->oid_name);
521521
}
522522
/* update the OID number, if any */

0 commit comments

Comments
 (0)