Page MenuHomeFreeBSD

intrng: add intrcnt/intrnames limit checking
AbandonedPublic

Authored by ehem_freebsd_m5p.com on Jan 31 2023, 10:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 6, 9:42 PM
Unknown Object (File)
Sat, Apr 6, 10:13 AM
Unknown Object (File)
Feb 3 2024, 6:24 AM
Unknown Object (File)
Jan 4 2024, 9:59 AM
Unknown Object (File)
Dec 20 2023, 8:30 AM
Unknown Object (File)
Dec 11 2023, 1:02 AM
Unknown Object (File)
Nov 21 2023, 12:08 AM
Unknown Object (File)
Sep 5 2023, 11:56 PM

Details

Reviewers
markj
mmel
Summary

The intrcnt and intrnames tables ars a limited resource, best not to
overflow without a panic. Keep track of the limit and check during
allocations.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 49546
Build 46436: arc lint + arc unit

Event Timeline

Hmm, reordering this means it needs this one extra bit (later on this should disappear).

Fixing copy/paste error for the panic messages.

Then on review realize the test needs to be this instead.

ehem_freebsd_m5p.com retitled this revision from intrng: add intrcnt limit checking to intrng: add intrcnt/intrnames limit checking.Feb 8 2023, 12:34 AM
ehem_freebsd_m5p.com edited the summary of this revision. (Show Details)

The name/description was hinting at the state of my tree when I noticed the issue. I suspect this will go in in a different state, update to reflect the situation better.

I'm including this as a parent of D36610 since it results in a very handy cut-off point where the old interrupt counters can be disabled with a tiny change, before removing all of the source.

freebsd_igalic.co added inline comments.
sys/kern/subr_intr.c
5

I'm glad we're using compilers these days that won't 💩 themselves on encountering Unicode in source

The patch looks ok to me otherwise.

sys/kern/subr_intr.c
5

In general we add copyrights for commits that make substantial changes to a file. I think a general rule is something like >10% of lines changed, though I can't find that anywhere in our documentation in the moment. I don't think this qualifies.

ehem_freebsd_m5p.com added inline comments.
sys/kern/subr_intr.c
5

Notice just above the start of the diff, the block which lists the files? To the right of the "Files" tab is the "Stack" tab. I've got a batch of commits/patches here, perhaps they don't individually hit the threshold, but as a group they should match appropriate thresholds for "kern_intr.c" and "subr_intr.c" (possibly also "intr_machdep.c" for PPC/x86).

My belief is whichever gets in first should add the Copyright line with the appropriate date.

Huh, Phabricator only accepted one comment being marked as done?

This is also funky due to D38437 changing enough lines to make this troublesome.

Huh, Phabricator only accepted one comment being marked as done?

This is also funky due to D38437 changing enough lines to make this troublesome.

It looks like D38437 effectively supersedes this patch?

sys/kern/subr_intr.c
5

Then the addition of a copyright line should be done in a standalone diff.

I would disagree about D38437 superseding this, but it does offer some equivalent functionality. As a result, this is indeed no longer appropriate.