CVE-2026-139542: md: take reconfig_mutex when enabling PPL on an inactive array
In the Linux kernel, the following vulnerability has been resolved:
md: take reconfigmutex when enabling PPL on an inactive array
consistencypolicystore() sets MDHASPPL for an external-metadata array that is not running yet, without holding reconfigmutex. But ->pers is only assigned after pers->run() returns, so "not running" also covers an mdrun() that is in progress under the lock.
If the write lands inside raid5run() after loginit() has decided not to set up PPL, or after a failed pplinitlog() has cleared the flag, the flag ends up set with conf->logprivate still NULL. The next idle pass of raid5d() then does:
raid5d() -> handleactivestripes() -> logflushstripetoraid() -> pplwritestriperun()
and dereferences the NULL pplconf:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002 KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] RIP: 0010:pplwritestriperun+0x60/0x1320 drivers/md/raid5-ppl.c:538
Take reconfigmutex around the update and refuse it with -EBUSY once the array is running, in which case ->changeconsistencypolicy() is the right interface.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using Linux MD RAID5 with external metadata are exposed when PPL can be enabled while an array is inactive or transitioning through md_run(). The issue concerns a race during array startup rather than ordinary operation of an already running array.
What is required to trigger the failure?
A write enabling PPL through consistency_policy_store() must race with RAID5 initialization after log_init() has declined to create PPL or after ppl_init_log() has cleared the PPL flag following failure. This can leave MD_HAS_PPL set while the PPL configuration pointer is NULL.
What is the impact if the race occurs?
On a later raid5d idle pass, the kernel can dereference the NULL PPL configuration in ppl_write_stripe_run(), causing a KASAN-reported null-pointer dereference and general protection fault.
What behavior changes with the fix?
Enabling PPL is serialized with reconfig_mutex, and the request is rejected with -EBUSY if the array is already running. For a running array, the appropriate path is the array personality's change_consistency_policy() interface.