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
F115644712: D48168.id148330.diff
Sat, Apr 26, 11:48 AM
Unknown Object (File)
Thu, Apr 17, 6:52 PM
Unknown Object (File)
Thu, Apr 17, 2:42 AM
Unknown Object (File)
Fri, Apr 11, 8:16 PM
Unknown Object (File)
Wed, Apr 9, 12:33 AM
Unknown Object (File)
Sat, Apr 5, 8:53 PM
Unknown Object (File)
Sat, Apr 5, 10:09 AM
Unknown Object (File)
Mar 21 2025, 5:51 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 Not Applicable
Unit
Tests Not Applicable