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
F144387024: D48168.id148302.diff
Sun, Feb 8, 4:33 AM
F144355349: D48168.id148330.diff
Sun, Feb 8, 12:35 AM
Unknown Object (File)
Tue, Feb 3, 10:05 AM
Unknown Object (File)
Sat, Jan 31, 6:16 AM
Unknown Object (File)
Sat, Jan 10, 10:54 PM
Unknown Object (File)
Dec 30 2025, 7:01 AM
Unknown Object (File)
Dec 25 2025, 2:09 AM
Unknown Object (File)
Dec 21 2025, 12:44 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