Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-49878— resource: fix region_intersects() vs add_memory_driver_managed()

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于resource处理模块在处理CXL内存时region_intersects函数与add_memory_driver_managed函数之间的冲突。

AI Predicted 5.5 Difficulty: Moderate EPSS 0.30% · P21

Possible ATT&CK Techniques 1 AI

T1055 · Process Injection

Affected Version Matrix 18

VendorProduct Version RangeStatus
Linux Linux c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< 333fbaf6864a4ca031367eb947961a1f3484d337 affected
c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< 1d5f85f1b7db79c75c9e07d6571ce2a7bdf725c4 affected
c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< 8a6fef7d22a1d952aed68584d3fcc0d018d2bdc3 affected
c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< 4b90d2eb451b357681063ba4552b10b39d7ad885 affected
c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< 393331e16ce205e036e58b3d8ca4ee2e635f21d9 affected
c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< 06ff97a20b8c9e9d256b0d2c3e87f78f8ccea3de affected
c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< 927abc5b7d6d2c2e936bec5a2f71d9512c5e72f7 affected
c221c0b0308fd01d9fb33a16f64d2fd95f8830a4< b4afe4183ec77f230851ea139d91e5cf2644c68b affected
… +10 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2024-49878

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
resource: fix region_intersects() vs add_memory_driver_managed()
Source: CVE Program / CVE List V5
Vulnerability 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".
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于resource处理模块在处理CXL内存时region_intersects函数与add_memory_driver_managed函数之间的冲突。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 ~ 333fbaf6864a4ca031367eb947961a1f3484d337 -
Linux Linux 5.1 -

II. Public POCs for CVE-2024-49878

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2024-49878

请登录查看更多情报信息。

Patches & Fixes for CVE-2024-49878 (7)

Same Patch Batch · Linux · 2024-10-21 · 372 CVEs total

CVE-2024-50043 9.8 CRITICAL nfsd: fix possible badness in FREE_STATEID
CVE-2022-48985 9.8 CRITICAL net: mana: Fix race on per-CQ variable napi work_done
CVE-2024-47695 9.8 CRITICAL RDMA/rtrs-clt: Reset cid to con_num - 1 to stay in bounds
CVE-2024-50033 9.8 CRITICAL slip: make slhc_remember() more robust against malicious packets
CVE-2024-49855 9.8 CRITICAL nbd: fix race between timeout and normal completion
CVE-2024-50047 9.8 CRITICAL smb: client: fix UAF in async decryption
CVE-2024-50046 9.8 CRITICAL NFSv4: Prevent NULL-pointer dereference in nfs42_complete_copies()
CVE-2022-49003 9.8 CRITICAL nvme: fix SRCU protection of nvme_ns_head list
CVE-2024-49996 9.4 CRITICAL cifs: Fix buffer overflow when parsing NFS reparse points
CVE-2024-47678 9.4 CRITICAL icmp: change the order of rate limits
CVE-2022-49017 8.8 HIGH tipc: re-fetch skb cb after tipc_msg_validate
CVE-2024-50029 8.8 HIGH Bluetooth: hci_conn: Fix UAF in hci_enhanced_setup_sync
CVE-2024-50041 8.8 HIGH i40e: Fix macvlan leak by synchronizing access to mac_filter_hash
CVE-2024-49939 8.8 HIGH wifi: rtw89: avoid to add interface to list twice when SER
CVE-2022-48960 8.8 HIGH net: hisilicon: Fix potential use-after-free in hix5hd2_rx()
CVE-2022-48962 8.8 HIGH net: hisilicon: Fix potential use-after-free in hisi_femac_rx()
CVE-2022-48964 8.8 HIGH ravb: Fix potential use-after-free in ravb_rx_gbeth()
CVE-2022-49015 8.8 HIGH net: hsr: Fix potential use-after-free
CVE-2022-48967 8.8 HIGH NFC: nci: Bounds check struct nfc_target arrays
CVE-2024-49930 8.8 HIGH wifi: ath11k: fix array out-of-bound access in SoC stats

Showing top 20 of 372 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2024-49878

No comments yet


Leave a comment