diff options
author | Suzuki K Poulose <suzuki.poulose@arm.com> | 2021-10-19 17:31:51 +0100 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2021-10-27 11:46:01 -0600 |
commit | f9efc79d0ab9b780bf74c624616bd50c6cefdeeb (patch) | |
tree | 35abada55255aaf2bff5efb11ba891b357db6c53 /include/sound/memalloc.h | |
parent | adf35d058617c94810c03628efd7ae7821f3c5e7 (diff) | |
download | linux-stable-f9efc79d0ab9b780bf74c624616bd50c6cefdeeb.tar.gz linux-stable-f9efc79d0ab9b780bf74c624616bd50c6cefdeeb.tar.bz2 linux-stable-f9efc79d0ab9b780bf74c624616bd50c6cefdeeb.zip |
coresight: trbe: Work around write to out of range
TRBE implementations affected by Arm erratum (2253138 or 2224489), could
write to the next address after the TRBLIMITR.LIMIT, instead of wrapping
to the TRBBASER. This implies that the TRBE could potentially corrupt :
- A page used by the rest of the kernel/user (if the LIMIT = end of
perf ring buffer)
- A page within the ring buffer, but outside the driver's range.
[head, head + size]. This may contain some trace data, may be
consumed by the userspace.
We workaround this erratum by :
- Making sure that there is at least an extra PAGE space left in the
TRBE's range than we normally assign. This will be additional to other
restrictions (e.g, the TRBE alignment for working around
TRBE_WORKAROUND_OVERWRITE_IN_FILL_MODE, where there is a minimum of
PAGE_SIZE. Thus we would have 2 * PAGE_SIZE)
- Adjust the LIMIT to leave the last PAGE_SIZE out of the TRBE's allowed
range (i.e, TRBEBASER...TRBLIMITR.LIMIT), by :
TRBLIMITR.LIMIT -= PAGE_SIZE
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20211019163153.3692640-14-suzuki.poulose@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'include/sound/memalloc.h')
0 files changed, 0 insertions, 0 deletions