{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2024-50263", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2024-10-21T19:36:19.982Z", "datePublished": "2024-11-11T13:58:18.577Z", "dateUpdated": "2026-08-05T11:42:52.945Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T11:42:52.945Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nfork: only invoke khugepaged, ksm hooks if no error\n\nThere is no reason to invoke these hooks early against an mm that is in an\nincomplete state.\n\nThe change in commit d24062914837 (\"fork: use __mt_dup() to duplicate\nmaple tree in dup_mmap()\") makes this more pertinent as we may be in a\nstate where entries in the maple tree are not yet consistent.\n\nTheir placement early in dup_mmap() only appears to have been meaningful\nfor early error checking, and since functionally it'd require a very small\nallocation to fail (in practice 'too small to fail') that'd only occur in\nthe most dire circumstances, meaning the fork would fail or be OOM'd in\nany case.\n\nSince both khugepaged and KSM tracking are there to provide optimisations\nto memory performance rather than critical functionality, it doesn't\nreally matter all that much if, under such dire memory pressure, we fail\nto register an mm with these.\n\nAs a result, we follow the example of commit d2081b2bf819 (\"mm:\nkhugepaged: make khugepaged_enter() void function\") and make ksm_fork() a\nvoid function also.\n\nWe only expose the mm to these functions once we are done with them and\nonly if no error occurred in the fork operation." } ], "metrics": [ { "cvssV3_1": { "version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH" }, "scenarios": [ { "lang": "en", "value": "AV:L - The vulnerability is reached through ordinary local syscalls — `madvise(MADV_HUGEPAGE)`/`MADV_MERGEABLE` to register the mm with khugepaged/KSM, then `fork()`/`clone()` forced down an error path in `dup_mmap()`. No network or remote input is involved.\nAC:L - The attacker controls both sides of the race: they choose when the child mm is added to the khugepaged/KSM lists, they deterministically force the `dup_mmap()` error (e.g. SIGKILL landing in the VMA loop via `fatal_signal_pending(current)`, or ENOMEM under a self-imposed memcg limit), and KSM's blocking `mmap_read_lock(mm)` means ksmd is handed the lock the moment `dup_mmap()` unlocks. The attempt can be repeated indefinitely at no cost.\nPR:L - Only an unprivileged local user account is needed — `fork()`, `madvise()` and `prctl(PR_SET_MEMORY_MERGE)` require no capabilities, and no namespace tricks are necessary.\nUI:N - The attacker's own process performs the fork and the error injection; khugepaged/ksmd are always-running kernel threads. No victim action is required.\nS:U - The corruption is confined to kernel memory management structures within the same security authority; there is no VM, IOMMU or sandbox boundary crossed.\nC:H - khugepaged/KSM walk the child's maple tree containing the parent's VMAs and, once the parent unmaps them, freed `vm_area_struct`s — a use-after-free read of attacker-groomable heap memory, plus cross-address-space page/rmap confusion that can expose another address space's page contents.\nI:H - The scanners act on stale/foreign VMAs while installing PMDs and rewriting PTEs and rmap in the wrong mm (`collapse_file()`, `collapse_pte_mapped_thp()`, KSM's `try_to_merge_one_page()` with `vma->vm_mm != mm`), and dereference `vm_ops`/`anon_vma`/`vm_file` from freed objects — a UAF/type-confusion primitive usable for arbitrary write and control-flow hijack.\nA:H - At minimum the walkers dereference `XA_ZERO_ENTRY` (0x406) as a `struct vm_area_struct *`, producing a NULL-page kernel oops in khugepaged/ksmd; the use-after-free on parent VMAs likewise causes kernel crashes and, with `panic_on_oops`, a full panic." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "include/linux/ksm.h", "kernel/fork.c" ], "versions": [ { "version": "d2406291483775ecddaee929231a39c70c08fda2", "lessThan": "3b85aa0da8cd01173b9afd1f70080fbb9576c4b0", "status": "affected", "versionType": "git" }, { "version": "d2406291483775ecddaee929231a39c70c08fda2", "lessThan": "985da552a98e27096444508ce5d853244019111f", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "include/linux/ksm.h", "kernel/fork.c" ], "versions": [ { "version": "6.8", "status": "affected" }, { "version": "0", "lessThan": "6.8", "status": "unaffected", "versionType": "semver" }, { "version": "6.11.7", "lessThanOrEqual": "6.11.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.12", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.8", "versionEndExcluding": "6.11.7" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.8", "versionEndExcluding": "6.12" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/3b85aa0da8cd01173b9afd1f70080fbb9576c4b0" }, { "url": "https://git.kernel.org/stable/c/985da552a98e27096444508ce5d853244019111f" }, { "url": "https://project-zero.issues.chromium.org/issues/373391951" } ], "title": "fork: only invoke khugepaged, ksm hooks if no error", "x_generator": { "engine": "bippy-1.2.0" } } } }