# CVE-2024-50022: device-dax: correct pgoff align in dax\_set\_mapping()

> 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, NVD) `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.34% (percentile 20, 2026-11-26)
- **Published:** 2024-10-21T19:39:27.873Z
- **Modified:** 2026-06-17T08:03:23.943Z

## Who should check

- Anyone running Linux \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< 9c4198dfdca818c5ce19c764d90eabd156bbc6da; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< b822007e8db341d6f175c645ed79866db501ad86; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< e877427d218159ac29c9326100920d24330c9ee6; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< 7fcbd9785d4c17ea533c42f20a9083a83f301fa6
- Anyone running Linux 5.17

## Description

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

device-dax: correct pgoff align in dax\_set\_mapping()

pgoff should be aligned using ALIGN\_DOWN() instead of ALIGN().  Otherwise,
vmf-\>address not aligned to fault\_size will be aligned to the next
alignment, that can result in memory failure getting the wrong address.

It's a subtle situation that only can be observed in
page\_mapped\_in\_vma() after the page is page fault handled by
dev\_dax\_huge\_fault.  Generally, there is little chance to perform
page\_mapped\_in\_vma in dev-dax's page unless in specific error injection
to the dax device to trigger an MCE - memory-failure.  In that case,
page\_mapped\_in\_vma() will be triggered to determine which task is
accessing the failure address and kill that task in the end.


We used self-developed dax device (which is 2M aligned mapping) , to
perform error injection to random address.  It turned out that error
injected to non-2M-aligned address was causing endless MCE until panic.
Because page\_mapped\_in\_vma() kept resulting wrong address and the task
accessing the failure address was never killed properly:


\[ 3783.719419\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3784.049006\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3784.049190\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3784.448042\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3784.448186\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3784.792026\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3784.792179\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3785.162502\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3785.162633\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3785.461116\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3785.461247\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3785.764730\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3785.764859\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3786.042128\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3786.042259\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3786.464293\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3786.464423\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3786.818090\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3786.818217\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered
\[ 3787.085297\] mce: Uncorrected hardware memory error in user-access at 
200c9742380
\[ 3787.085424\] Memory failure: 0x200c9742: recovery action for dax page: 
Recovered

It took us several weeks to pinpoint this problem,  but we eventually
used bpftrace to trace the page fault and mce address and successfully
identified the issue.


Joao added:

; Likely we never reproduce in production because we always pin
: device-dax regions in the region align they provide (Qemu does
: similarly with prealloc in hugetlb/file backed memory).  I think this
: bug requires that we touch \*unpinned\* device-dax regions unaligned to
: the device-dax selected alignment (page size i.e.  4K/2M/1G)

## Affected and fixed versions

- Linux: \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< 9c4198dfdca818c5ce19c764d90eabd156bbc6da; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< b822007e8db341d6f175c645ed79866db501ad86; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< e877427d218159ac29c9326100920d24330c9ee6; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< 7fcbd9785d4c17ea533c42f20a9083a83f301fa6 (cvelist)
- Linux: 5.17 (cvelist)

## Mitigation

- Upgrade Linux to 7fcbd9785d4c17ea533c42f20a9083a83f301fa6 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-50022.md
Affected: Linux >= b9b5777f09be84d0de472ded2253d2f5101427f2, < 9c4198dfdca818c5ce19c764d90eabd156bbc6da; >= b9b5777f09be84d0de472ded2253d2f5101427f2, < b822007e8db341d6f175c645ed79866db501ad86; >= b9b5777f09be84d0de472ded2253d2f5101427f2, < e877427d218159ac29c9326100920d24330c9ee6; >= b9b5777f09be84d0de472de…
Fixed in: Linux 9c4198dfdca818c5ce19c764d90eabd156bbc6da, Linux 7fcbd9785d4c17ea533c42f20a9083a83f301fa6

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-2024-50022 being exploited?

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

### How serious is CVE-2024-50022?

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

### Which versions are affected by CVE-2024-50022?

Linux \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< 9c4198dfdca818c5ce19c764d90eabd156bbc6da; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< b822007e8db341d6f175c645ed79866db501ad86; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< e877427d218159ac29c9326100920d24330c9ee6; \>= b9b5777f09be84d0de472ded2253d2f5101427f2, \< 7fcbd9785d4c17ea533c42f20a9083a83f301fa6; Linux 5.17.

### Is there a fix for CVE-2024-50022?

Yes. Fixed in Linux 9c4198dfdca818c5ce19c764d90eabd156bbc6da, Linux 7fcbd9785d4c17ea533c42f20a9083a83f301fa6. Upgrade Linux to 7fcbd9785d4c17ea533c42f20a9083a83f301fa6 or later.

### How do I check if I'm affected by CVE-2024-50022?

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/9c4198dfdca818c5ce19c764d90eabd156bbc6da>
- patch: <https://git.kernel.org/stable/c/b822007e8db341d6f175c645ed79866db501ad86>
- patch: <https://git.kernel.org/stable/c/e877427d218159ac29c9326100920d24330c9ee6>
- patch: <https://git.kernel.org/stable/c/7fcbd9785d4c17ea533c42f20a9083a83f301fa6>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## 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-2024-50022>

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