CVE-2024-57874: arm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL
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 settaggedaddrctrl() 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, NTARMSYSTEMCALL). 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.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-57874?
CVE-2024-57874 is categorized as a medium severity vulnerability in the Linux kernel.
How do I fix CVE-2024-57874?
To mitigate CVE-2024-57874, update your Linux kernel to a patched version that removes the vulnerability.
What versions of the Linux kernel are affected by CVE-2024-57874?
CVE-2024-57874 affects multiple versions of the Linux kernel between 5.10 and 6.13-rc1.
What is the main impact of CVE-2024-57874?
The main impact of CVE-2024-57874 is a potential information leak due to improper initialization in the ptrace system call.
Is there a workaround for CVE-2024-57874?
There is no known workaround for CVE-2024-57874; it is recommended to apply patches as they become available.