fork: only invoke khugepaged, ksm hooks if no error
Published Nov 11, 2024
7.8
HIGHCVSS 3.1
EPSS 0.21%
Description
There is no reason to invoke these hooks early against an mm that is in an incomplete state.
The change in commit d24062914837 ("fork: use __mt_dup() to duplicate maple tree in dup_mmap()") makes this more pertinent as we may be in a state where entries in the maple tree are not yet consistent.
Their placement early in dup_mmap() only appears to have been meaningful for early error checking, and since functionally it'd require a very small allocation to fail (in practice 'too small to fail') that'd only occur in the most dire circumstances, meaning the fork would fail or be OOM'd in any case.
Since both khugepaged and KSM tracking are there to provide optimisations to memory performance rather than critical functionality, it doesn't really matter all that much if, under such dire memory pressure, we fail to register an mm with these.
As a result, we follow the example of commit d2081b2bf819 ("mm: khugepaged: make khugepaged_enter() void function") and make ksm_fork() a void function also.
We only expose the mm to these functions once we are done with them and only if no error occurred in the fork operation.
Affected products
-
Affected
- ≥ , <
- ≥ , <
-
Affected
- 6.8
Unaffected
- ≥ 0, < 6.8
- ≥ 6.11.7, ≤ 6.11.*
- 6.12
- ≥ 6.8 · < 6.11.7
- 6.12
- 6.12
- 6.12
- 6.12
- 6.12
No data.
Red Hat Enterprise Linux 6
kernel
Out of support scope
Red Hat Enterprise Linux 7
kernel
Out of support scope
Red Hat Enterprise Linux 7
kernel-rt
Out of support scope
Red Hat Enterprise Linux 8
kernel
Not affected
Red Hat Enterprise Linux 8
kernel-rt
Not affected
Red Hat Enterprise Linux 9
kernel
Not affected
Red Hat Enterprise Linux 9
kernel-rt
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 6 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 7 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Out of support scope | n/a |
| Red Hat Enterprise Linux 8 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat mitigation
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.
References (9)
- https://access.redhat.com/security/cve/CVE-2024-50263 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2325208 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2024-45170 Advisory
- https://git.kernel.org/stable/c/3b85aa0da8cd01173b9afd1f70080fbb9576c4b0 Patch
- https://git.kernel.org/stable/c/985da552a98e27096444508ce5d853244019111f Patch
- https://lore.kernel.org/linux-cve-announce/2024111122-CVE-2024-50263-5c65@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2024-50263
- https://project-zero.issues.chromium.org/issues/373391951
- https://www.cve.org/CVERecord?id=CVE-2024-50263
Change history (0)
No recorded changes yet.
CVE.org / MITRE
CISA Vulnrichment
No data
GitHub
No data