CVE-2024-42318

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-42318
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-42318.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-42318
Downstream
Related
Published
2024-08-17T09:09:31.160Z
Modified
2025-11-27T02:33:44.886836Z
Summary
landlock: Don't lose track of restrictions on cred_transfer
Details

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 credprepare LSM hook; but in one special case (when KEYCTLSESSIONTOPARENT updates the parent's credentials), the credtransfer LSM hook is used instead. Landlock only implements the credprepare hook, not credtransfer, so KEYCTLSESSIONTOPARENT 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 credtransfer hook that does the same thing as the existing credprepare hook. (Implemented by having hookcredprepare() call hookcredtransfer() so that the two functions are less likely to accidentally diverge in the future.)

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/blob/cc431b3424123d84bcd7afd4de150b33f117a8ef/cves/2024/42xxx/CVE-2024-42318.json"
}
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
385975dca53eb41031d0cbd1de318eb1bc5d6bb9
Fixed
916c648323fa53b89eedb34a0988ddaf01406117
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
385975dca53eb41031d0cbd1de318eb1bc5d6bb9
Fixed
0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
385975dca53eb41031d0cbd1de318eb1bc5d6bb9
Fixed
16896914bace82d7811c62f3b6d5320132384f49
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
385975dca53eb41031d0cbd1de318eb1bc5d6bb9
Fixed
b14cc2cf313bd29056fadbc8ecd7f957cf5791ff
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
385975dca53eb41031d0cbd1de318eb1bc5d6bb9
Fixed
39705a6c29f8a2b93cf5b99528a55366c50014d1

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.13.0
Fixed
5.15.165
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.103
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.44
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.10.3