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)
Sat, Oct 4, 4:29 PM
Unknown Object (File)
Sat, Oct 4, 9:12 AM
Unknown Object (File)
Sat, Oct 4, 8:59 AM
Unknown Object (File)
Tue, Sep 23, 2:25 AM
Unknown Object (File)
Mon, Sep 22, 10:32 AM
Unknown Object (File)
Sep 18 2025, 8:33 PM
Unknown Object (File)
Sep 17 2025, 6:40 AM
Unknown Object (File)
Sep 16 2025, 9:02 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