CVE-2026-142866: md/raid5: fix NULL pointer dereference in raid5_free_percpu

Published Dec 3, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

md/raid5: fix NULL pointer dereference in raid5freepercpu

If cpuhpstateaddinstance() fails in raid5allocpercpu() (e.g., the startup callback raid456cpuupprepare fails due to an allocation failure), conf->node is never added to the cpuhp instance list and its pprev remains NULL (from kzalloc initialization).

When setupconf() then jumps to abort, freeconf() calls raid5freepercpu(), which checks conf->percpu (non-NULL, since it was allocated before the cpuhp failure) and proceeds to call cpuhpstateremoveinstance(). This calls hlistdel() on the unhashed node, which dereferences node->pprev (NULL), causing a kernel panic.

Guard the removal with hlistunhashedlockless() so that the cpuhp instance is only removed if it was actually added. The lockless variant uses READONCE() for the pprev read, which is safe here because the actual removal is synchronized by cpuhpstatemutex inside cpuhpstateremoveinstance().

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Guard the cpuhp instance removal in raid5_free_percpu() with hlist_unhashed_lockless() so it is only removed if it was added.

Event History

Dec 3, 2026
CVE Published
via MITRE·03:21 AM
Data Sourced
via MITRE·03:21 AM
Description

Frequently Asked Questions

1

When can the kernel panic occur?

The panic requires RAID5 per-CPU setup to begin successfully enough to allocate conf->percpu, followed by failure of cpuhp_state_add_instance(). The subsequent configuration-abort cleanup can then attempt to remove a CPU hotplug instance that was never added.

2

Does this affect an already registered CPU hotplug instance?

The described failure is specific to an unhashed instance whose list linkage was never established because registration failed. The fix avoids removal unless the instance was actually added to the CPU hotplug instance list.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203