ftrace: Do not blindly read the ip address in ftrace_bug()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 05736a427f7e16be948ccbf39782bd3a6ae16b14 · < 97524384762c1fb9b3ded931498dd2047bd0de81| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ftrace: Do not blindly read the ip address in ftrace_bug()
It was reported that a bug on arm64 caused a bad ip address to be used for updating into a nop in ftrace_init(), but the error path (rightfully) returned -EINVAL and not -EFAULT, as the bug caused more than one error to occur. But because -EINVAL was returned, the ftrace_bug() tried to report what was at the location of the ip address, and read it directly. This caused the machine to panic, as the ip was not pointing to a valid memory address.
Instead, read the ip address with copy_from_kernel_nofault() to safely access the memory, and if it faults, report that the address faulted, otherwise report what was in that location.
From the CVE record · Linux
The Linux kernel’s ftrace_bug() can read an invalid instruction address while reporting an ftrace_init() error, causing the machine to panic. The input does not describe an attacker-controlled trigger or specify network, authentication, or user-interaction conditions.
Engineers running the Linux kernel should check their versions; affected versions are not specified in the input.