[PATCH 5/7] aarch64: Mitigations for string functions when MTE is enabled.

Richard Earnshaw rearnsha@arm.com
Mon Jun 15 14:40:27 GMT 2020


This is a place-holder patch for the changes needed to the string
functions to make them safe when using memory tagging.  It is expected
that this patch will be replaced before the final series is committed.

When memory tagging is enabled, functions must not fetch data beyond a
granule boundary.  Unfortunately, this affects a number of the
optimized string operations for aarch64 which assume that provided a
page boundary is not being crossed any amount of data within the page
may be accessed.  This patch replaces the existing string functions
with variants that do not violate the granule size limitations that
now exist.

This patch has not been tuned for performance.
---
 sysdeps/aarch64/memchr.S                 | 21 ++++++++++++++++++++-
 sysdeps/aarch64/multiarch/strlen_asimd.S |  2 +-
 sysdeps/aarch64/strchr.S                 | 15 +++++++++++++++
 sysdeps/aarch64/strchrnul.S              | 14 +++++++++++++-
 sysdeps/aarch64/strcmp.S                 | 12 +++++++++---
 sysdeps/aarch64/strcpy.S                 |  2 +-
 sysdeps/aarch64/strlen.S                 |  2 +-
 sysdeps/aarch64/strncmp.S                | 10 ++++++++--
 sysdeps/aarch64/strrchr.S                | 15 ++++++++++++++-
 9 files changed, 82 insertions(+), 11 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-aarch64-Mitigations-for-string-functions-when-MTE-is.patch
Type: text/x-patch
Size: 6450 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20200615/f68324e9/attachment-0001.bin>


More information about the Libc-alpha mailing list