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)
Wed, Nov 26, 12:09 AM
Unknown Object (File)
Fri, Nov 21, 3:24 AM
Unknown Object (File)
Thu, Nov 20, 3:44 AM
Unknown Object (File)
Mon, Nov 17, 8:05 PM
Unknown Object (File)
Nov 8 2025, 9:30 AM
Unknown Object (File)
Nov 3 2025, 1:14 PM
Unknown Object (File)
Nov 3 2025, 7:35 AM
Unknown Object (File)
Oct 30 2025, 10:10 PM
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