# CVE-2024-42318: landlock: Don't lose track of restrictions on cred\_transfer

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; 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.35% (percentile 21, 2026-11-26)
- **Published:** 2024-08-17T09:09:31.160Z
- **Modified:** 2026-08-05T11:36:37.407Z

## Who should check

- Anyone running Linux \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 916c648323fa53b89eedb34a0988ddaf01406117; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 16896914bace82d7811c62f3b6d5320132384f49; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< b14cc2cf313bd29056fadbc8ecd7f957cf5791ff; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 39705a6c29f8a2b93cf5b99528a55366c50014d1
- Anyone running Linux 5.13

## 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.)

## Affected and fixed versions

- Linux: \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 916c648323fa53b89eedb34a0988ddaf01406117; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 16896914bace82d7811c62f3b6d5320132384f49; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< b14cc2cf313bd29056fadbc8ecd7f957cf5791ff; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 39705a6c29f8a2b93cf5b99528a55366c50014d1 (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- Upgrade Linux to 39705a6c29f8a2b93cf5b99528a55366c50014d1 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-42318. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-42318.md
Affected: Linux >= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, < 916c648323fa53b89eedb34a0988ddaf01406117; >= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, < 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c; >= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, < 16896914bace82d7811c62f3b6d5320132384f49; >= 385975dca53eb41031d0cbd…
Fixed in: Linux 916c648323fa53b89eedb34a0988ddaf01406117, Linux 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c, Linux 16896914bace82d7811c62f3b6d5320132384f49, Linux 39705a6c29f8a2b93cf5b99528a55366c50014d1

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

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

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

High: CVSS 8.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 916c648323fa53b89eedb34a0988ddaf01406117; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 16896914bace82d7811c62f3b6d5320132384f49; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< b14cc2cf313bd29056fadbc8ecd7f957cf5791ff; \>= 385975dca53eb41031d0cbd1de318eb1bc5d6bb9, \< 39705a6c29f8a2b93cf5b99528a55366c50014d1; Linux 5.13.

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

Yes. Fixed in Linux 916c648323fa53b89eedb34a0988ddaf01406117, Linux 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c, Linux 16896914bace82d7811c62f3b6d5320132384f49, Linux 39705a6c29f8a2b93cf5b99528a55366c50014d1. Upgrade Linux to 39705a6c29f8a2b93cf5b99528a55366c50014d1 or later.

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

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/916c648323fa53b89eedb34a0988ddaf01406117>
- patch: <https://git.kernel.org/stable/c/0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c>
- patch: <https://git.kernel.org/stable/c/16896914bace82d7811c62f3b6d5320132384f49>
- patch: <https://git.kernel.org/stable/c/b14cc2cf313bd29056fadbc8ecd7f957cf5791ff>
- patch: <https://git.kernel.org/stable/c/39705a6c29f8a2b93cf5b99528a55366c50014d1>
- other: <https://lore.kernel.org/all/20240817.shahka3Ee1iy@digikod.net/>
- other: <https://www.openwall.com/lists/oss-security/2024/08/17/2>
- other: <https://bugs.chromium.org/p/project-zero/issues/detail?id=2566>
- other: <http://www.openwall.com/lists/oss-security/2024/08/17/2>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

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

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