# CVE-2024-42317: mm/huge\_memory: avoid PMD-size page cache if needed

> 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.30% (percentile 16, 2026-11-26)
- **Published:** 2024-08-17T09:09:30.433Z
- **Modified:** 2026-10-21T13:17:46.720Z

## Who should check

- Anyone running Linux \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< 2011c0ebaf710194900f31e64e2ab7295037dbab; \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< e60f62f75c99740a28e2bf7e6044086033012a16; \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< d659b715e94ac039803d7601505d3473393fc0be
- Anyone running Linux 5.17

## Description

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

mm/huge\_memory: avoid PMD-size page cache if needed

xarray can't support arbitrary page cache size.  the largest and supported
page cache size is defined as MAX\_PAGECACHE\_ORDER by commit 099d90642a71
("mm/filemap: make MAX\_PAGECACHE\_ORDER acceptable to xarray").  However,
it's possible to have 512MB page cache in the huge memory's collapsing
path on ARM64 system whose base page size is 64KB.  512MB page cache is
breaking the limitation and a warning is raised when the xarray entry is
split as shown in the following example.

\[root@dhcp-10-26-1-207 ~\]\# cat /proc/1/smaps \| grep KernelPageSize
KernelPageSize:       64 kB
\[root@dhcp-10-26-1-207 ~\]\# cat /tmp/test.c
   :
int main(int argc, char \*\*argv)
{
	const char \*filename = TEST\_XFS\_FILENAME;
	int fd = 0;
	void \*buf = (void \*)-1, \*p;
	int pgsize = getpagesize();
	int ret = 0;

	if (pgsize != 0x10000) {
		fprintf(stdout, "System with 64KB base page size is required!\\n");
		return -EPERM;
	}

	system("echo 0 \> /sys/devices/virtual/bdi/253:0/read\_ahead\_kb");
	system("echo 1 \> /proc/sys/vm/drop\_caches");

	/\* Open the xfs file \*/
	fd = open(filename, O\_RDONLY);
	assert(fd \> 0);

	/\* Create VMA \*/
	buf = mmap(NULL, TEST\_MEM\_SIZE, PROT\_READ, MAP\_SHARED, fd, 0);
	assert(buf != (void \*)-1);
	fprintf(stdout, "mapped buffer at 0x%p\\n", buf);

	/\* Populate VMA \*/
	ret = madvise(buf, TEST\_MEM\_SIZE, MADV\_NOHUGEPAGE);
	assert(ret == 0);
	ret = madvise(buf, TEST\_MEM\_SIZE, MADV\_POPULATE\_READ);
	assert(ret == 0);

	/\* Collapse VMA \*/
	ret = madvise(buf, TEST\_MEM\_SIZE, MADV\_HUGEPAGE);
	assert(ret == 0);
	ret = madvise(buf, TEST\_MEM\_SIZE, MADV\_COLLAPSE);
	if (ret) {
		fprintf(stdout, "Error %d to madvise(MADV\_COLLAPSE)\\n", errno);
		goto out;
	}

	/\* Split xarray entry. Write permission is needed \*/
	munmap(buf, TEST\_MEM\_SIZE);
	buf = (void \*)-1;
	close(fd);
	fd = open(filename, O\_RDWR);
	assert(fd \> 0);
	fallocate(fd, FALLOC\_FL\_KEEP\_SIZE \| FALLOC\_FL\_PUNCH\_HOLE,
 		  TEST\_MEM\_SIZE - pgsize, pgsize);
out:
	if (buf != (void \*)-1)
		munmap(buf, TEST\_MEM\_SIZE);
	if (fd \> 0)
		close(fd);

	return ret;
}

\[root@dhcp-10-26-1-207 ~\]\# gcc /tmp/test.c -o /tmp/test
\[root@dhcp-10-26-1-207 ~\]\# /tmp/test
 ------------\[ cut here \]------------
 WARNING: CPU: 25 PID: 7560 at lib/xarray.c:1025 xas\_split\_alloc+0xf8/0x128
 Modules linked in: nft\_fib\_inet nft\_fib\_ipv4 nft\_fib\_ipv6 nft\_fib    \\
 nft\_reject\_inet nf\_reject\_ipv4 nf\_reject\_ipv6 nft\_reject nft\_ct      \\
 nft\_chain\_nat nf\_nat nf\_conntrack nf\_defrag\_ipv6 nf\_defrag\_ipv4      \\
 ip\_set rfkill nf\_tables nfnetlink vfat fat virtio\_balloon drm fuse   \\
 xfs libcrc32c crct10dif\_ce ghash\_ce sha2\_ce sha256\_arm64 virtio\_net  \\
 sha1\_ce net\_failover virtio\_blk virtio\_console failover dimlib virtio\_mmio
 CPU: 25 PID: 7560 Comm: test Kdump: loaded Not tainted 6.10.0-rc7-gavin+ \#9
 Hardware name: QEMU KVM Virtual Machine, BIOS edk2-20240524-1.el9 05/24/2024
 pstate: 83400005 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
 pc : xas\_split\_alloc+0xf8/0x128
 lr : split\_huge\_page\_to\_list\_to\_order+0x1c4/0x780
 sp : ffff8000ac32f660
 x29: ffff8000ac32f660 x28: ffff0000e0969eb0 x27: ffff8000ac32f6c0
 x26: 0000000000000c40 x25: ffff0000e0969eb0 x24: 000000000000000d
 x23: ffff8000ac32f6c0 x22: ffffffdfc0700000 x21: 0000000000000000
 x20: 0000000000000000 x19: ffffffdfc0700000 x18: 0000000000000000
 x17: 0000000000000000 x16: ffffd5f3708ffc70 x15: 0000000000000000
 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
 x11: ffffffffffffffc0 x10: 0000000000000040 x9 : ffffd5f3708e692c
 x8 : 0000000000000003 x7 : 0000000000000000 x6 : ffff0000e0969eb8
 x5 : ffffd5f37289e378 x4 : 0000000000000000 x3 : 0000000000000c40
 x2 : 000000000000000d x1 : 000000000000000c x0 : 0000000000000000
 Call trace:
  xas\_split\_alloc+0xf8/0x128
  split\_huge\_page\_to\_list\_to\_order+0x1c4/0x780
  truncate\_inode\_partial\_folio+0xdc/0x160
  truncate\_inode\_pages\_range+0x1b4/0x4a8
  truncate\_pagecache\_range+0x84/0xa
---truncated---

## Affected and fixed versions

- Linux: \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< 2011c0ebaf710194900f31e64e2ab7295037dbab; \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< e60f62f75c99740a28e2bf7e6044086033012a16; \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< d659b715e94ac039803d7601505d3473393fc0be (cvelist)
- Linux: 5.17 (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-42317. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-42317.md
Affected: Linux >= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, < 2011c0ebaf710194900f31e64e2ab7295037dbab; >= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, < e60f62f75c99740a28e2bf7e6044086033012a16; >= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, < d659b715e94ac039803d7601505d3473393fc0be; Linux 5.17
Fixed in: Linux 2011c0ebaf710194900f31e64e2ab7295037dbab

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

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

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

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

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

Linux \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< 2011c0ebaf710194900f31e64e2ab7295037dbab; \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< e60f62f75c99740a28e2bf7e6044086033012a16; \>= 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3, \< d659b715e94ac039803d7601505d3473393fc0be; Linux 5.17.

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

Yes. Fixed in Linux 2011c0ebaf710194900f31e64e2ab7295037dbab. No fix listed yet: follow the vendor advisory.

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

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/e60f62f75c99740a28e2bf7e6044086033012a16>
- patch: <https://git.kernel.org/stable/c/d659b715e94ac039803d7601505d3473393fc0be>
- other: <https://git.kernel.org/stable/c/2011c0ebaf710194900f31e64e2ab7295037dbab>

## 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-42317>

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