8.8high
landlock: Don't lose track of restrictions on cred_transfer
- Severity
- 8.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.30% (higher than 24% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
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
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9 before 916c648323fa53b89eedb34a0988ddaf01406117, from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9 before 0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c, from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9 before 16896914bace82d7811c62f3b6d5320132384f49, from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9 before b14cc2cf313bd29056fadbc8ecd7f957cf5791ff, from 385975dca53eb41031d0cbd1de318eb1bc5d6bb9 before 39705a6c29f8a2b93cf5b99528a55366c50014d1, 5.13 Not affected: before 5.13, from 5.15.165 up to 5.15.*, from 6.1.103 up to 6.1.*, from 6.6.44 up to 6.6.*, from 6.10.3 up to 6.10.*, from 6.11 up to * | CVE List |
| linux linux_kernel | from 5.13 before 5.15.165, from 5.16 before 6.1.103, from 6.2 before 6.6.44, from 6.7 before 6.10.3 | NVD |
All scores
| Linux | 8.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.)
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: landlock: no pierda de vista las restricciones en cred_transfer Cuando se reemplaza la estructura cred de un proceso, esto _almost_ always invoca el gancho LSM cred_prepare; pero en un caso especial (cuando KEYCTL_SESSION_TO_PARENT actualiza las credenciales de los padres), se utiliza el gancho LSM cred_transfer. Landlock solo implementa el gancho cred_prepare, no cred_transfer, por lo que KEYCTL_SESSION_TO_PARENT hace que se pierda toda la información sobre las restricciones de Landlock. Básicamente, esto significa que un proceso con la capacidad de utilizar las llamadas al sistema fork() y keyctl() puede deshacerse de todas las restricciones de Landlock sobre sí mismo. Solucionelo agregando un gancho cred_transfer que haga lo mismo que el gancho cred_prepare existente. (Se implementa haciendo que hook_cred_prepare() llame a hook_cred_transfer() para que sea menos probable que las dos funciones diverjan accidentalmente en el futuro).
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-42318 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2024-42318 changed 2026-08-04 | Public domain |