CVE-2024-57874
JSON

6.1medium

arm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL

Severity
6.1medium CVSS:3.1 by CISA-ADP
Exploit likelihood
0.21% (higher than 11% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: arm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL Currently tagged_addr_ctrl_set() doesn't initialize the temporary 'ctrl' variable, and a SETREGSET call with a length of zero will leave this uninitialized. Consequently tagged_addr_ctrl_set() will consume an arbitrary value, potentially leaking up to 64 bits of memory from the kernel stack. The read is limited to a specific slot on the stack, and the issue does not provide a write mechanism. As set_tagged_addr_ctrl() only accepts values where bits [63:4] zero and rejects other values, a partial SETREGSET attempt will randomly succeed or fail depending on the value of the uninitialized value, and the exposure is significantly limited. Fix this by initializing the temporary value before copying the regset from userspace, as for other regsets (e.g. NT_PRSTATUS, NT_PRFPREG, NT_ARM_SYSTEM_CALL). In the case of a zero-length write, the existing value of the tagged address ctrl will be retained. The NT_ARM_TAGGED_ADDR_CTRL regset is only visible in the user_aarch64_view used by a native AArch64 task to manipulate another native AArch64 task. As get_tagged_addr_ctrl() only returns an error value when called for a compat task, tagged_addr_ctrl_get() and tagged_addr_ctrl_set() should never observe an error value from get_tagged_addr_ctrl(). Add a WARN_ON_ONCE() to both to indicate that such an error would be unexpected, and error handlnig is not missing in either case.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 2200aa7154cb7ef76bac93e98326883ba64bfa2e before 1152dd13845efde5554f80c7e1233bae1d26bd3e, from 2200aa7154cb7ef76bac93e98326883ba64bfa2e before 1c176f5155ee6161fee6f416b64aa50394d3f220, from 2200aa7154cb7ef76bac93e98326883ba64bfa2e before 1370cf3eb5495d70e00547598583a4cd45b40b99, from 2200aa7154cb7ef76bac93e98326883ba64bfa2e before 96035c0093db258975b8887676afe59a64c34a72, from 2200aa7154cb7ef76bac93e98326883ba64bfa2e before abd614bbfcee73247495bd9472da8f85ac83546e, from 2200aa7154cb7ef76bac93e98326883ba64bfa2e before ca62d90085f4af36de745883faab9f8a7cbb45d3, 5.10
Not affected: before 5.10, from 5.10.231 up to 5.10.*, from 5.15.174 up to 5.15.*, from 6.1.120 up to 6.1.*, from 6.6.66 up to 6.6.*, from 6.12.5 up to 6.12.*
CVE List
linux linux_kernelfrom 5.10 before 5.10.231, from 5.11 before 5.15.174, from 5.16 before 6.1.120, from 6.2 before 6.6.66, from 6.7 before 6.12.5, 6.13NVD

All scores

CISA-ADP6.1medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H
NVD6.1medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H

Classification

CWE-908

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: arm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL Currently tagged_addr_ctrl_set() doesn't initialize the temporary 'ctrl' variable, and a SETREGSET call with a length of zero will leave this uninitialized. Consequently tagged_addr_ctrl_set() will consume an arbitrary value, potentially leaking up to 64 bits of memory from the kernel stack. The read is limited to a specific slot on the stack, and the issue does not provide a write mechanism. As set_tagged_addr_ctrl() only accepts values where bits [63:4] zero and rejects other values, a partial SETREGSET attempt will randomly succeed or fail depending on the value of the uninitialized value, and the exposure is significantly limited. Fix this by initializing the temporary value before copying the regset from userspace, as for other regsets (e.g. NT_PRSTATUS, NT_PRFPREG, NT_ARM_SYSTEM_CALL). In the case of a zero-length write, the existing value of the tagged address ctrl will be retained. The NT_ARM_TAGGED_ADDR_CTRL regset is only visible in the user_aarch64_view used by a native AArch64 task to manipulate another native AArch64 task. As get_tagged_addr_ctrl() only returns an error value when called for a compat task, tagged_addr_ctrl_get() and tagged_addr_ctrl_set() should never observe an error value from get_tagged_addr_ctrl(). Add a WARN_ON_ONCE() to both to indicate that such an error would be unexpected, and error handlnig is not missing in either case.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: arm64: ptrace: arreglo de SETREGSET parcial para NT_ARM_TAGGED_ADDR_CTRL Actualmente, tagged_addr_ctrl_set() no inicializa la variable temporal 'ctrl', y una llamada a SETREGSET con una longitud de cero la dejará sin inicializar. En consecuencia, tagged_addr_ctrl_set() consumirá un valor arbitrario, lo que potencialmente filtrará hasta 64 bits de memoria de la pila del kernel. La lectura está limitada a una ranura específica en la pila, y el problema no proporciona un mecanismo de escritura. Como set_tagged_addr_ctrl() solo acepta valores donde los bits [63:4] sean cero y rechaza otros valores, un intento de SETREGSET parcial tendrá éxito o fallará aleatoriamente dependiendo del valor del valor no inicializado, y la exposición es significativamente limitada. Solucione esto inicializando el valor temporal antes de copiar el conjunto de registros desde el espacio de usuario, como para otros conjuntos de registros (por ejemplo, NT_PRSTATUS, NT_PRFPREG, NT_ARM_SYSTEM_CALL). En el caso de una escritura de longitud cero, se conservará el valor existente de la dirección etiquetada ctrl. El conjunto de registros NT_ARM_TAGGED_ADDR_CTRL solo es visible en la vista user_aarch64_view utilizada por una tarea nativa de AArch64 para manipular otra tarea nativa de AArch64. Como get_tagged_addr_ctrl() solo devuelve un valor de error cuando se llama para una tarea de compatibilidad, tagged_addr_ctrl_get() y tagged_addr_ctrl_set() nunca deben observar un valor de error de get_tagged_addr_ctrl(). Agregue un WARN_ON_ONCE() a ambos para indicar que dicho error sería inesperado y que la gestión de errores no falta en ninguno de los casos.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-57874 changed 2026-05-11CVE Terms of Use
NVDCVE-2024-57874 changed 2026-06-17Public domain