Page MenuHomeFreeBSD

x86/intr: Handle case of disabling MSI after release
ClosedPublic

Authored by jhibbits on Jul 29 2025, 6:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 15, 11:51 AM
Unknown Object (File)
Sat, Apr 11, 7:53 PM
Unknown Object (File)
Thu, Apr 9, 10:57 PM
Unknown Object (File)
Tue, Apr 7, 9:16 PM
Unknown Object (File)
Mon, Apr 6, 8:36 AM
Unknown Object (File)
Sat, Apr 4, 3:12 AM
Unknown Object (File)
Fri, Apr 3, 4:40 PM
Unknown Object (File)
Thu, Apr 2, 12:04 PM

Details

Summary

Once an interrupt source is registered it's never deregistered.
However, when an MSI is released the pointer for it becomes NULLed out,
resulting in a NULL pointer dereference when attempting to disable the
now-released MSI source. Add NULL check to avoid this.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65837
Build 62720: arc lint + arc unit

Event Timeline

jhibbits created this revision.
sys/x86/x86/msi.c
222

Multi-line comment should have a blank line before it. It also should formatted like this:

/*
 * Interrupt sources are always registered, but never unregistered.
...
This revision is now accepted and ready to land.Aug 13 2025, 3:48 AM
ehem_freebsd_m5p.com added inline comments.
sys/x86/x86/msi.c
227–228

Have you ever actually seen this occur?

I believe this is impossible as it would mean isrc == NULL which shouldn't ever occur.