CVE-2024-39477

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-39477
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-39477.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-39477
Downstream
Published
2024-07-05T06:55:07Z
Modified
2025-10-17T07:53:06.143379Z
Summary
mm/hugetlb: do not call vma_add_reservation upon ENOMEM
Details

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

mm/hugetlb: do not call vmaaddreservation upon ENOMEM

sysbot reported a splat [1] on _unmaphugepagerange(). This is because vmaneedsreservation() can return -ENOMEM if allocatefileregionentries() fails to allocate the file_region struct for the reservation.

Check for that and do not call vmaaddreservation() if that is the case, otherwise regionabort() and regiondel() will see that we do not have any file_regions.

If we detect that vmaneedsreservation() returned -ENOMEM, we clear the hugetlbrestorereserve flag as if this reservation was still consumed, so freehugefolio() will not increment the resv count.

[1] https://lore.kernel.org/linux-mm/0000000000004096100617c58d54@google.com/T/#ma5983bc1ab18a54910da83416b3f89f3c7ee43aa

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
df7a6d1f64056aec572162c5d35ed9ff86ece6f3
Fixed
aa998f9dcb34c28448f86e8f5490f20d5eb0eac7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
df7a6d1f64056aec572162c5d35ed9ff86ece6f3
Fixed
8daf9c702ee7f825f0de8600abff764acfedea13

Affected versions

v6.*

v6.10-rc1
v6.8
v6.8-rc6
v6.8-rc7
v6.9
v6.9-rc1
v6.9-rc2
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6
v6.9-rc7
v6.9.1
v6.9.2
v6.9.3
v6.9.4

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.9.0
Fixed
6.9.5