# CVE-2022-49400: md: Don't set mddev private to NULL in raid0 pers-\>free

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 14, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-02-26T02:12:28.139Z
- **Modified:** 2026-06-17T05:17:56.470Z

## Who should check

- Anyone running Linux \>= 00e3d58f50a875343124bcf5a9637520a492b0d1, \< f63fd1e0e0fc158023cc67ea6a07e278019061ba; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< b7a51df785031cc49caf1c59766ca89cfa97b54b; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< 7da3454a65f8a56e65dfb44fa0ccac08cbc2f5a1; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< 0f2571ad7a30ff6b33cde142439f9378669f8b4f; 92053ae0398a58c6914e807d5e070297ba8cfe88; \>= 5.15.17, \< 5.15.46; \>= 5.16.3, \< 5.17
- Anyone running Linux 5.17

## Description

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

md: Don't set mddev private to NULL in raid0 pers-\>free

In normal stop process, it does like this:
   do\_md\_stop
      \|
   \_\_md\_stop (pers-\>free(); mddev-\>private=NULL)
      \|
   md\_free (free mddev)
\_\_md\_stop sets mddev-\>private to NULL after pers-\>free. The raid device
will be stopped and mddev memory is free. But in reshape, it doesn't
free the mddev and mddev will still be used in new raid.

In reshape, it first sets mddev-\>private to new\_pers and then runs
old\_pers-\>free(). Now raid0 sets mddev-\>private to NULL in raid0\_free.
The new raid can't work anymore. It will panic when dereference
mddev-\>private because of NULL pointer dereference.

It can panic like this:
\[63010.814972\] kernel BUG at drivers/md/raid10.c:928!
\[63010.819778\] invalid opcode: 0000 \[\#1\] PREEMPT SMP NOPTI
\[63010.825011\] CPU: 3 PID: 44437 Comm: md0\_resync Kdump: loaded Not tainted 5.14.0-86.el9.x86\_64 \#1
\[63010.833789\] Hardware name: Dell Inc. PowerEdge R6415/07YXFK, BIOS 1.15.0 09/11/2020
\[63010.841440\] RIP: 0010:raise\_barrier+0x161/0x170 \[raid10\]
\[63010.865508\] RSP: 0018:ffffc312408bbc10 EFLAGS: 00010246
\[63010.870734\] RAX: 0000000000000000 RBX: ffffa00bf7d39800 RCX: 0000000000000000
\[63010.877866\] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffa00bf7d39800
\[63010.884999\] RBP: 0000000000000000 R08: fffffa4945e74400 R09: 0000000000000000
\[63010.892132\] R10: ffffa00eed02f798 R11: 0000000000000000 R12: ffffa00bbc435200
\[63010.899266\] R13: ffffa00bf7d39800 R14: 0000000000000400 R15: 0000000000000003
\[63010.906399\] FS:  0000000000000000(0000) GS:ffffa00eed000000(0000) knlGS:0000000000000000
\[63010.914485\] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
\[63010.920229\] CR2: 00007f5cfbe99828 CR3: 0000000105efe000 CR4: 00000000003506e0
\[63010.927363\] Call Trace:
\[63010.929822\]  ? bio\_reset+0xe/0x40
\[63010.933144\]  ? raid10\_alloc\_init\_r10buf+0x60/0xa0 \[raid10\]
\[63010.938629\]  raid10\_sync\_request+0x756/0x1610 \[raid10\]
\[63010.943770\]  md\_do\_sync.cold+0x3e4/0x94c
\[63010.947698\]  md\_thread+0xab/0x160
\[63010.951024\]  ? md\_write\_inc+0x50/0x50
\[63010.954688\]  kthread+0x149/0x170
\[63010.957923\]  ? set\_kthread\_struct+0x40/0x40
\[63010.962107\]  ret\_from\_fork+0x22/0x30

Removing the code that sets mddev-\>private to NULL in raid0 can fix
problem.

## Affected and fixed versions

- Linux: \>= 00e3d58f50a875343124bcf5a9637520a492b0d1, \< f63fd1e0e0fc158023cc67ea6a07e278019061ba; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< b7a51df785031cc49caf1c59766ca89cfa97b54b; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< 7da3454a65f8a56e65dfb44fa0ccac08cbc2f5a1; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< 0f2571ad7a30ff6b33cde142439f9378669f8b4f; 92053ae0398a58c6914e807d5e070297ba8cfe88; \>= 5.15.17, \< 5.15.46; \>= 5.16.3, \< 5.17 (cvelist)
- Linux: 5.17 (cvelist)

## Mitigation

- Upgrade Linux to 5.17 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49400.md
Affected: Linux >= 00e3d58f50a875343124bcf5a9637520a492b0d1, < f63fd1e0e0fc158023cc67ea6a07e278019061ba; >= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, < b7a51df785031cc49caf1c59766ca89cfa97b54b; >= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, < 7da3454a65f8a56e65dfb44fa0ccac08cbc2f5a1; >= 0c031fd37f69deb0cd8c43b…
Fixed in: Linux 7da3454a65f8a56e65dfb44fa0ccac08cbc2f5a1, Linux 0f2571ad7a30ff6b33cde142439f9378669f8b4f, Linux 5.15.46, Linux 5.17

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-2022-49400 being exploited?

There is no confirmed exploitation: CVE-2022-49400 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49400?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49400?

Linux \>= 00e3d58f50a875343124bcf5a9637520a492b0d1, \< f63fd1e0e0fc158023cc67ea6a07e278019061ba; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< b7a51df785031cc49caf1c59766ca89cfa97b54b; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< 7da3454a65f8a56e65dfb44fa0ccac08cbc2f5a1; \>= 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952, \< 0f2571ad7a30ff6b33cde142439f9378669f8b4f; 92053ae0398a58c6914e807d5e070297ba8cfe88; \>= 5.15.17, \< 5.15.46; \>= 5.16.3, \< 5.17; Linux 5.17.

### Is there a fix for CVE-2022-49400?

Yes. Fixed in Linux 7da3454a65f8a56e65dfb44fa0ccac08cbc2f5a1, Linux 0f2571ad7a30ff6b33cde142439f9378669f8b4f, Linux 5.15.46, Linux 5.17. Upgrade Linux to 5.17 or later.

### How do I check if I'm affected by CVE-2022-49400?

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

- patch: <https://git.kernel.org/stable/c/f63fd1e0e0fc158023cc67ea6a07e278019061ba>
- patch: <https://git.kernel.org/stable/c/b7a51df785031cc49caf1c59766ca89cfa97b54b>
- patch: <https://git.kernel.org/stable/c/7da3454a65f8a56e65dfb44fa0ccac08cbc2f5a1>
- patch: <https://git.kernel.org/stable/c/0f2571ad7a30ff6b33cde142439f9378669f8b4f>

## 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-2022-49400>

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