CVE-2024-42318
landlock: Don't lose track of restrictions on cred_transfer
Check your servers for CVE-2024-42318
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-42318 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
landlock: Don't lose track of restrictions on cred_transfer
When a process' cred struct is replaced, this _almost_ always invokes the cred_prepare LSM hook; but in one special case (when KEYCTL_SESSION_TO_PARENT updates the parent's credentials), the cred_transfer LSM hook is used instead. Landlock only implements the cred_prepare hook, not cred_transfer, so KEYCTL_SESSION_TO_PARENT causes all information on Landlock restrictions to be lost.
This basically means that a process with the ability to use the fork() and keyctl() syscalls can get rid of all Landlock restrictions on itself.
Fix it by adding a cred_transfer hook that does the same thing as the existing cred_prepare hook. (Implemented by having hook_cred_prepare() call hook_cred_transfer() so that the two functions are less likely to accidentally diverge in the future.)
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- changed: the damage reaches other components, such as the host of a container or other users
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.30%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 24.0% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 10 Sep 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, before 916c648323fa53b89eedb34a0988ddaf01406117 affected from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, before 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c affected from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, before 16896914bace82d7811c62f3b6d5320132384f49 affected from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, before b14cc2cf313bd29056fadbc8ecd7f957cf5791ff affected from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, before 39705a6c29f8a2b93cf5b99528a55366c50014d1
Other versions: unaffected
|
| Linux |
affected 5.13 unaffected before 5.13 unaffected from 5.15.165 up to and including 5.15.* unaffected from 6.1.103 up to and including 6.1.* unaffected from 6.6.44 up to and including 6.6.* unaffected from 6.10.3 up to and including 6.10.* unaffected 6.11 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-42318 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-42318
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-42318
trivy image --scanners vuln IMAGE | grep CVE-2024-42318
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/916c648323fa53b89eedb34a0988ddaf01406117 git.kernel.org
- https://git.kernel.org/stable/c/0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c git.kernel.org
- https://git.kernel.org/stable/c/16896914bace82d7811c62f3b6d5320132384f49 git.kernel.org
- https://git.kernel.org/stable/c/b14cc2cf313bd29056fadbc8ecd7f957cf5791ff git.kernel.org
- https://git.kernel.org/stable/c/39705a6c29f8a2b93cf5b99528a55366c50014d1 git.kernel.org
- https://lore.kernel.org/all/20240817.shahka3Ee1iy@digikod.net/ lore.kernel.org
- https://www.openwall.com/lists/oss-security/2024/08/17/2 openwall.com
- https://bugs.chromium.org/p/project-zero/issues/detail?id=2566 bugs.chromium.org
- http://www.openwall.com/lists/oss-security/2024/08/17/2 openwall.com
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html lists.debian.org
Source: the record CVE-2024-42318 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse