coresight: ETR: Fix ETR buffer use-after-free issue
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
fdd3ceb0001da6768bede9779a0190a42e65c404| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
coresight: ETR: Fix ETR buffer use-after-free issue
When ETR is enabled as CS_MODE_SYSFS, if the buffer size is changed and enabled again, currently sysfs_buf will point to the newly allocated memory(buf_new) and free the old memory(buf_old). But the etr_buf that is being used by the ETR remains pointed to buf_old, not updated to buf_new. In this case, it will result in a memory use-after-free issue.
Fix this by checking ETR's mode before updating and releasing buf_old, if the mode is CS_MODE_SYSFS, then skip updating and releasing it.
From the CVE record · Linux
The Linux kernel’s CoreSight ETR buffer handling has a use-after-free issue. When ETR is enabled in CS_MODE_SYSFS, changing the buffer size and enabling it again can leave ETR using a freed buffer. The input does not specify authentication requirements or whether an attacker can trigger this remotely.
Engineers running Linux kernels with CoreSight ETR should check whether their kernel includes the fix; affected versions are not specified.