# CVE-2026-139682: md/raid5: don't BUG() on an inconsistent reshape state from the superblock

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-11-30T13:37:00.369Z
- **Modified:** 2026-11-30T14:19:56.297Z

> **AI summary (AI-generated, claude-haiku-5-5):** An attacker who can present a crafted md RAID superblock can crash the Linux kernel during array assembly by triggering a BUG() on inconsistent reshape state.

## Who should check

- Anyone running Linux \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 996c0df409b1cf2d4e9bb0dce0cb4ba0c1f50ed7; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< c093f0dd9119bee681facb5af2efbe476945666c; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< ef2a78ba818d0cd046c2f1614aebd200a26e01d6; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 50485f1be262c2085443662b4a8be084fa958b9d; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 136a221544d919896a0f1bff8802eb51d0dff496; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 57926a227a2d610f586b99de2638a02b72e99762; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< fa4122799a5bff6902848eafa00dc8e245ba261f; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 0669c7dbd1d375f279e607a24addc2f1dae2d4f3
- Anyone running Linux 2.6.30

## Description

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

md/raid5: don't BUG() on an inconsistent reshape state from the superblock

raid5\_run() branches on mddev-\>reshape\_position. When it is MaxSector --
no reshape in progress -- the else branch asserts that nothing else
describes one:

	BUG\_ON(mddev-\>level != mddev-\>new\_level);
	BUG\_ON(mddev-\>layout != mddev-\>new\_layout);
	BUG\_ON(mddev-\>chunk\_sectors != mddev-\>new\_chunk\_sectors);
	BUG\_ON(mddev-\>delta\_disks != 0);

Nothing enforces that invariant. Both superblock validators copy the
reshape fields straight off disk without cross-checking them against
each other: super\_1\_validate() takes reshape\_position, delta\_disks,
new\_level, new\_layout and new\_chunk from the superblock whenever
MD\_FEATURE\_RESHAPE\_ACTIVE is set, and super\_90\_validate() does the same
for minor version 91. A superblock that sets the reshape feature while
leaving reshape\_position at the MaxSector sentinel therefore reaches the
else branch with a non-zero delta\_disks, and assembling the array takes
the machine down:

  kernel BUG at drivers/md/raid5.c:8117!
  Oops: invalid opcode: 0000 \[\#1\] SMP KASAN NOPTI
  RIP: 0010:raid5\_run+0x11a7/0x1670 drivers/md/raid5.c:8117
  Call Trace:
   md\_run+0xc2f/0x2510 drivers/md/md.c:6779
   do\_md\_run+0x36/0x660 drivers/md/md.c:6880
   array\_state\_store+0x9c5/0xcf0 drivers/md/md.c:4765
   md\_attr\_store+0x1c5/0x330 drivers/md/md.c:6158
   sysfs\_kf\_write+0xf2/0x150 fs/sysfs/file.c:145
   kernfs\_fop\_write\_iter+0x3e0/0x5f0 fs/kernfs/file.c:345

This is reachable by anyone who can present an md superblock, so BUG()
is the wrong response. Refuse to start the array instead, the way the
reshape\_position != MaxSector branch a few lines above already refuses a
reshape it cannot resume. Nothing has been allocated at this point --
the journal-and-bitmap check just above returns -EINVAL the same way --
so there is nothing to unwind.

## Affected and fixed versions

- Linux: \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 996c0df409b1cf2d4e9bb0dce0cb4ba0c1f50ed7; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< c093f0dd9119bee681facb5af2efbe476945666c; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< ef2a78ba818d0cd046c2f1614aebd200a26e01d6; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 50485f1be262c2085443662b4a8be084fa958b9d; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 136a221544d919896a0f1bff8802eb51d0dff496; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 57926a227a2d610f586b99de2638a02b72e99762; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< fa4122799a5bff6902848eafa00dc8e245ba261f; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 0669c7dbd1d375f279e607a24addc2f1dae2d4f3 (cvelist)
- Linux: 2.6.30 (cvelist)

## Technologies

Linux kernel

## Mitigation

- Upgrade Linux to 0669c7dbd1d375f279e607a24addc2f1dae2d4f3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-139682. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-139682.md
Affected: Linux >= 91adb56473febeeb3ef657bb5147ddd355465700, < 996c0df409b1cf2d4e9bb0dce0cb4ba0c1f50ed7; >= 91adb56473febeeb3ef657bb5147ddd355465700, < c093f0dd9119bee681facb5af2efbe476945666c; >= 91adb56473febeeb3ef657bb5147ddd355465700, < ef2a78ba818d0cd046c2f1614aebd200a26e01d6; >= 91adb56473febeeb3ef657b…
Fixed in: Linux 996c0df409b1cf2d4e9bb0dce0cb4ba0c1f50ed7, Linux 50485f1be262c2085443662b4a8be084fa958b9d, Linux 136a221544d919896a0f1bff8802eb51d0dff496, Linux 57926a227a2d610f586b99de2638a02b72e99762, Linux 0669c7dbd1d375f279e607a24addc2f1dae2d4f3

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-139682 being exploited?

There is no confirmed exploitation: CVE-2026-139682 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-139682?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-139682?

Linux \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 996c0df409b1cf2d4e9bb0dce0cb4ba0c1f50ed7; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< c093f0dd9119bee681facb5af2efbe476945666c; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< ef2a78ba818d0cd046c2f1614aebd200a26e01d6; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 50485f1be262c2085443662b4a8be084fa958b9d; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 136a221544d919896a0f1bff8802eb51d0dff496; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 57926a227a2d610f586b99de2638a02b72e99762; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< fa4122799a5bff6902848eafa00dc8e245ba261f; \>= 91adb56473febeeb3ef657bb5147ddd355465700, \< 0669c7dbd1d375f279e607a24addc2f1dae2d4f3; Linux 2.6.30.

### Is there a fix for CVE-2026-139682?

Yes. Fixed in Linux 996c0df409b1cf2d4e9bb0dce0cb4ba0c1f50ed7, Linux 50485f1be262c2085443662b4a8be084fa958b9d, Linux 136a221544d919896a0f1bff8802eb51d0dff496, Linux 57926a227a2d610f586b99de2638a02b72e99762, Linux 0669c7dbd1d375f279e607a24addc2f1dae2d4f3. Upgrade Linux to 0669c7dbd1d375f279e607a24addc2f1dae2d4f3 or later.

### How do I check if I'm affected by CVE-2026-139682?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/996c0df409b1cf2d4e9bb0dce0cb4ba0c1f50ed7>
- other: <https://git.kernel.org/stable/c/c093f0dd9119bee681facb5af2efbe476945666c>
- other: <https://git.kernel.org/stable/c/ef2a78ba818d0cd046c2f1614aebd200a26e01d6>
- other: <https://git.kernel.org/stable/c/50485f1be262c2085443662b4a8be084fa958b9d>
- other: <https://git.kernel.org/stable/c/136a221544d919896a0f1bff8802eb51d0dff496>
- other: <https://git.kernel.org/stable/c/57926a227a2d610f586b99de2638a02b72e99762>
- other: <https://git.kernel.org/stable/c/fa4122799a5bff6902848eafa00dc8e245ba261f>
- other: <https://git.kernel.org/stable/c/0669c7dbd1d375f279e607a24addc2f1dae2d4f3>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-139682>

HTML: <https://flawdb.com/CVE-2026-139682> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-139682>
