# CVE-2024-49878: resource: fix region\_intersects() vs add\_memory\_driver\_managed()

> 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.40% (percentile 25, 2026-11-26)
- **Published:** 2024-10-21T18:01:17.468Z
- **Modified:** 2026-06-17T08:00:38.507Z

## Who should check

- Anyone running Linux \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 333fbaf6864a4ca031367eb947961a1f3484d337; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 4b90d2eb451b357681063ba4552b10b39d7ad885; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 393331e16ce205e036e58b3d8ca4ee2e635f21d9; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< b4afe4183ec77f230851ea139d91e5cf2644c68b
- Anyone running Linux 5.1

## Description

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

resource: fix region\_intersects() vs add\_memory\_driver\_managed()

On a system with CXL memory, the resource tree (/proc/iomem) related to
CXL memory may look like something as follows.

490000000-50fffffff : CXL Window 0
  490000000-50fffffff : region0
    490000000-50fffffff : dax0.0
      490000000-50fffffff : System RAM (kmem)

Because drivers/dax/kmem.c calls add\_memory\_driver\_managed() during
onlining CXL memory, which makes "System RAM (kmem)" a descendant of "CXL
Window X".  This confuses region\_intersects(), which expects all "System
RAM" resources to be at the top level of iomem\_resource.  This can lead to
bugs.

For example, when the following command line is executed to write some
memory in CXL memory range via /dev/mem,

 $ dd if=data of=/dev/mem bs=$((1 \<\< 10)) seek=$((0x490000000 \>\> 10)) count=1
 dd: error writing '/dev/mem': Bad address
 1+0 records in
 0+0 records out
 0 bytes copied, 0.0283507 s, 0.0 kB/s

the command fails as expected.  However, the error code is wrong.  It
should be "Operation not permitted" instead of "Bad address".  More
seriously, the /dev/mem permission checking in devmem\_is\_allowed() passes
incorrectly.  Although the accessing is prevented later because ioremap()
isn't allowed to map system RAM, it is a potential security issue.  During
command executing, the following warning is reported in the kernel log for
calling ioremap() on system RAM.

 ioremap on RAM at 0x0000000490000000 - 0x0000000490000fff
 WARNING: CPU: 2 PID: 416 at arch/x86/mm/ioremap.c:216 \_\_ioremap\_caller.constprop.0+0x131/0x35d
 Call Trace:
  memremap+0xcb/0x184
  xlate\_dev\_mem\_ptr+0x25/0x2f
  write\_mem+0x94/0xfb
  vfs\_write+0x128/0x26d
  ksys\_write+0xac/0xfe
  do\_syscall\_64+0x9a/0xfd
  entry\_SYSCALL\_64\_after\_hwframe+0x4b/0x53

The details of command execution process are as follows.  In the above
resource tree, "System RAM" is a descendant of "CXL Window 0" instead of a
top level resource.  So, region\_intersects() will report no System RAM
resources in the CXL memory region incorrectly, because it only checks the
top level resources.  Consequently, devmem\_is\_allowed() will return 1
(allow access via /dev/mem) for CXL memory region incorrectly. 
Fortunately, ioremap() doesn't allow to map System RAM and reject the
access.

So, region\_intersects() needs to be fixed to work correctly with the
resource tree with "System RAM" not at top level as above.  To fix it, if
we found a unmatched resource in the top level, we will continue to search
matched resources in its descendant resources.  So, we will not miss any
matched resources in resource tree anymore.

In the new implementation, an example resource tree

\|------------- "CXL Window 0" ------------\|
\|-- "System RAM" --\|

will behave similar as the following fake resource tree for
region\_intersects(, IORESOURCE\_SYSTEM\_RAM, ),

\|-- "System RAM" --\|\|-- "CXL Window 0a" --\|

Where "CXL Window 0a" is part of the original "CXL Window 0" that
isn't covered by "System RAM".

## Affected and fixed versions

- Linux: \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 333fbaf6864a4ca031367eb947961a1f3484d337; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 4b90d2eb451b357681063ba4552b10b39d7ad885; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 393331e16ce205e036e58b3d8ca4ee2e635f21d9; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< b4afe4183ec77f230851ea139d91e5cf2644c68b (cvelist)
- Linux: 5.1 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-49878.md
Affected: Linux >= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, < 333fbaf6864a4ca031367eb947961a1f3484d337; >= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, < 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4; >= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, < 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3; >= c221c0b0308fd01d9fb33a1…
Fixed in: Linux 333fbaf6864a4ca031367eb947961a1f3484d337, Linux 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4, Linux 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3, Linux 4b90d2eb451b357681063ba4552b10b39d7ad885, Linux 393331e16ce205e036e58b3d8ca4ee2e635f21d9, Linux 06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de, Linux 927ab…

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-49878 being exploited?

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

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

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

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

Linux \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 333fbaf6864a4ca031367eb947961a1f3484d337; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 4b90d2eb451b357681063ba4552b10b39d7ad885; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 393331e16ce205e036e58b3d8ca4ee2e635f21d9; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< 927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7; \>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4, \< b4afe4183ec77f230851ea139d91e5cf2644c68b; Linux 5.1.

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

Yes. Fixed in Linux 333fbaf6864a4ca031367eb947961a1f3484d337, Linux 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4, Linux 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3, Linux 4b90d2eb451b357681063ba4552b10b39d7ad885, Linux 393331e16ce205e036e58b3d8ca4ee2e635f21d9, Linux 06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de, Linux 927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7. No fix listed yet: follow the vendor advisory.

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

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/333fbaf6864a4ca031367eb947961a1f3484d337>
- patch: <https://git.kernel.org/stable/c/1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4>
- patch: <https://git.kernel.org/stable/c/8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3>
- patch: <https://git.kernel.org/stable/c/4b90d2eb451b357681063ba4552b10b39d7ad885>
- patch: <https://git.kernel.org/stable/c/393331e16ce205e036e58b3d8ca4ee2e635f21d9>
- patch: <https://git.kernel.org/stable/c/06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de>
- patch: <https://git.kernel.org/stable/c/927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7>
- patch: <https://git.kernel.org/stable/c/b4afe4183ec77f230851ea139d91e5cf2644c68b>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- 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-49878>

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