CVE-2026-138869: md: don't hand out the array before md_alloc() has added mddev->kobj

Published Nov 30, 2026
·
Updated

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

md: don't hand out the array before mdalloc() has added mddev->kobj

mdalloc() publishes the gendisk before it is done setting the mddev up:

disk->privatedata = mddev; ... error = adddisk(disk); if (error) goto outputdisk;

kobjectinit(&mddev->kobj, &mdktype); error = kobjectadd(&mddev->kobj, &disktodev(disk)->kobj, "%s", "md");

adddisk() makes /dev/mdN openable. mddev comes from mddevalloc() and is zeroed, so anything that gets in between adddisk() and kobjectadd() sees an mddev->kobj that has never been through kobjectinit() - no ktype, no kref, stateinitialized clear.

syzbot opens the array in that window and issues ADDNEWDISK:

kobject: '(null)' (ffff8880120640f0): is not initialized, yet kobjectget() is being called. WARNING: lib/kobject.c:642 at kobjectaddinternal+0xea/0xcd0 lib/kobject.c:225 kobjectaddvarg lib/kobject.c:374 [inline] kobjectadd+0x163/0x240 lib/kobject.c:426 bindrdevtoarray+0x80c/0xdd0 drivers/md/md.c:2621 mdaddnewdisk+0xe3b/0x1850 drivers/md/md.c:7684 mdioctl+0x200a/0x2610 drivers/md/md.c:8499

bindrdevtoarray() is not the only way in. mdrun() calls sysfscreategroup(&mddev->kobj, &mdredundancygroup), and internalcreategroup() has its own WARNON(!kobj->sd), so RUNARRAY in the same window warns too.

Every ioctl that can reach mddev->kobj runs under reconfigmutex, so hold it across adddisk() and kobjectadd(). An ioctl issued in the window now waits for mdalloc() to finish instead of seeing a half-built mddev, and opening the array still succeeds. The ioctls mdioctl() serves without the mutex only read array state and return -ENODEV on an array with no disks.

Hoisting kobjectinit() above adddisk() is not an option: commit ca39f7502425 ("md: fix mddev->kobj lifetime") moved it below adddisk() so that mdalloc()'s error paths, which free the mddev directly, never see an initialised kobject.

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:25 PM
Data Sourced
via MITRE·01:25 PM
Description

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