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
Unknown Object (File)
Mon, May 18, 6:57 AM
Unknown Object (File)
Thu, May 14, 2:26 AM
Unknown Object (File)
Wed, Apr 29, 8:36 PM
Unknown Object (File)
Wed, Apr 29, 12:58 PM
Unknown Object (File)
Wed, Apr 29, 5:40 AM
Unknown Object (File)
Mon, Apr 27, 6:19 PM
Unknown Object (File)
Thu, Apr 23, 3:23 AM
Unknown Object (File)
Apr 19 2026, 4:09 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