<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64972>64972</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            __strlen_aarch64_mte frequently triggered problem with MTE
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Gunkkk
      </td>
    </tr>
</table>

<pre>
    First of all, I could understand the implementations consideration for this MTE version strlen. It is needed by completeness of theory and the MTE team may request the coverage of all dereerences from heap opeartions .  
However, from our practical experiences, so many Applications could trigger the MTE syncerrors and bring collapses only if we open the MTE, since the android standard libc would use the MTE version strlen by default. 
```
#00 pc 00000000000937cc /apex/com.android.runtime/lib64/bionic/libc.so
(__strlen_aarch64_mte+12) 
```
The developers' coding style or the compiler optimizations could make the string objects free ahead and of course, it is theoretically UAF (use after free) .  Something like the case below, in which the string object would be free because of some Return Value Optimization techniques of C++.
```
vector.push_back(toCppString(**).c_str())
```
I have no idea whether it is necessary to bring MTE to the strlen?  I think the stirng object is greatly management inherently and there is no need to operate memory explicitly.  Although  there are definetely certain UAF or other possible memory safety problems like OOB of string object caused by strlen, the real world impact maybe limited. Of course, this is just a sensory intuition and a concrete and rational analysis is essential. 
So, is it possible to take some remedial actions and optimze the MTE  or just disable the MTE strlen for better and more practical usage of MTE please?
@DavidSpickett @kbeyls 

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVc1u4zgTfBr60hhBpn9iHXxIMp-_zWERYDO716BFlS2OKVJDUvZonn5BSk4m2BgCDFFkd3V1dZFD0CcL7MXmQWy-LniIrfP7_w_2fD4vateM-4P2IZI7Ehsj5CM9kXKDaWiwDXyIbBuKLUh3vUEHGzlqZwMpZ4Nu4PMrHZ2n2OpAf377H13gQ1oM0RvYgp4i6UAWaNBQPZJyKVaERQgpcWzh_Ei3TClEBH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