Page MenuHomeFreeBSD

hwpmc_x86: Fix NULL deref when loading on unsupported hardware
ClosedPublic

Authored by bnovkov on Dec 21 2024, 11:19 AM.
Tags
None
Referenced Files
F163437796: D48168.id148330.diff
Thu, Jul 23, 5:00 AM
Unknown Object (File)
Fri, Jul 17, 12:52 AM
Unknown Object (File)
Thu, Jul 16, 5:51 PM
Unknown Object (File)
Thu, Jul 16, 4:10 AM
Unknown Object (File)
Wed, Jul 15, 7:49 PM
Unknown Object (File)
Sun, Jul 5, 10:46 PM
Unknown Object (File)
May 31 2026, 2:28 AM
Unknown Object (File)
May 18 2026, 6:57 AM
Subscribers

Details

Summary

The pmc_md_{intialize, finalize} routines rely on a machine-dependent
structure to register the appropriate PMC interrupt handler. However,
the vendor-specific routines that allocate this structure may return
NULL for unsupported hardware, leading to a panic when the hwpmc module
gets loaded. This patch adds additional checks that fix this issue.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped