cbcvebase.
CVE-2024-49878
published 2024-10-21

CVE-2024-49878: In the Linux kernel, the following vulnerability has been resolved: resource: fix region_intersects() vs add_memory_driver_managed() On a system with CXL…

PriorityP422medium5.5CVSS 3.1
AVLACLPRLUINSUCNINAH
EPSS
0.30%
22.2th percentile
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)) 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

Affected

29 ranges· showing 25
VendorProductVersion rangeFixed in
debianlinux< linux 6.1.115-1 (bookworm)linux 6.1.115-1 (bookworm)
debianlinux-6.1< linux 6.1.115-1 (bookworm)linux 6.1.115-1 (bookworm)
linuxlinux
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < 333fbaf6864a4ca031367eb947961a1f3484d337333fbaf6864a4ca031367eb947961a1f3484d337
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c41d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc38a6fef7d22a1d952aed68584d3fcc0d018d2bdc3
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < 4b90d2eb451b357681063ba4552b10b39d7ad8854b90d2eb451b357681063ba4552b10b39d7ad885
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < 393331e16ce205e036e58b3d8ca4ee2e635f21d9393331e16ce205e036e58b3d8ca4ee2e635f21d9
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < 06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < 927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7
linuxlinux>= c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 < b4afe4183ec77f230851ea139d91e5cf2644c68bb4afe4183ec77f230851ea139d91e5cf2644c68b
linuxlinux_kernel>= 0 < 5.10.234-15.10.234-1
linuxlinux_kernel>= 0 < 6.1.115-16.1.115-1
linuxlinux_kernel>= 0 < 6.11.4-16.11.4-1
linuxlinux_kernel>= 0 < 6.11.4-16.11.4-1
linuxlinux_kernel>= 0 < 5.4.0-208.2285.4.0-208.228
linuxlinux_kernel>= 0 < 5.15.0-127.1375.15.0-127.137
linuxlinux_kernel>= 0 < 6.8.0-54.566.8.0-54.56
linuxlinux_kernel>= 0 < 6.11.0-18.186.11.0-18.18
linuxlinux_kernel>= 5.1 < 5.10.2275.10.227
linuxlinux_kernel>= 5.11 < 5.15.1685.15.168
linuxlinux_kernel>= 5.16 < 6.1.1136.1.113
linuxlinux_kernel>= 6.11 < 6.11.36.11.3
linuxlinux_kernel>= 6.2 < 6.6.556.6.55
linuxlinux_kernel>= 6.7 < 6.10.146.10.14

CVSS provenance

nvdv3.15.5MEDIUMCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
osv8.8HIGH
vendor_ubuntu8.8HIGH
vendor_debian5.5MEDIUM
vendor_msrc5.5MEDIUM
vendor_redhat5.5MEDIUM
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.