HomeFreeBSD

hwpmc_x86: Fix NULL deref when loading on unsupported hardware

Description

hwpmc_x86: Fix NULL deref when loading on unsupported hardware

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.

Reported by: Michael Butler (imb@protected-networks.net)
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D48168

Details

Provenance
bnovkovAuthored on Sat, Dec 21, 10:55 AM
Reviewer
kib
Differential Revision
D48168: hwpmc_x86: Fix NULL deref when loading on unsupported hardware
Parents
rG38b67578fb4b: hid: Correctly handle signed/unsigned quantities in kernel HID parser.
Branches
Unknown
Tags
Unknown