CVE-2024-57874

Source
https://cve.org/CVERecord?id=CVE-2024-57874
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-57874.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-57874
Downstream
Related
Published
2025-01-11T14:47:10.665Z
Modified
2026-03-20T12:41:02.332190Z
Severity
  • 6.1 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H CVSS Calculator
Summary
arm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL
Details

In the Linux kernel, the following vulnerability has been resolved:

arm64: ptrace: fix partial SETREGSET for NTARMTAGGEDADDRCTRL

Currently taggedaddrctrlset() doesn't initialize the temporary 'ctrl' variable, and a SETREGSET call with a length of zero will leave this uninitialized. Consequently taggedaddrctrlset() 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 settaggedaddr_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. NTPRSTATUS, NTPRFPREG, NTARMSYSTEM_CALL). In the case of a zero-length write, the existing value of the tagged address ctrl will be retained.

The NTARMTAGGEDADDRCTRL regset is only visible in the useraarch64view used by a native AArch64 task to manipulate another native AArch64 task. As gettaggedaddrctrl() only returns an error value when called for a compat task, taggedaddrctrlget() and taggedaddrctrlset() should never observe an error value from gettaggedaddrctrl(). Add a WARNONONCE() to both to indicate that such an error would be unexpected, and error handlnig is not missing in either case.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/57xxx/CVE-2024-57874.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
2200aa7154cb7ef76bac93e98326883ba64bfa2e
Fixed
1152dd13845efde5554f80c7e1233bae1d26bd3e
Fixed
1c176f5155ee6161fee6f416b64aa50394d3f220
Fixed
1370cf3eb5495d70e00547598583a4cd45b40b99
Fixed
96035c0093db258975b8887676afe59a64c34a72
Fixed
abd614bbfcee73247495bd9472da8f85ac83546e
Fixed
ca62d90085f4af36de745883faab9f8a7cbb45d3

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-57874.json"