<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/100629>100629</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
sanitizer implementation for prctl PR_SET_VMA does not handle null names
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
saethlin
</td>
</tr>
</table>
<pre>
The man page documents:
```
PR_SET_VMA_ANON_NAME
Set a name for anonymous virtual memory areas. val should be a pointer to a null-terminated string containing
the name. The name length including null byte cannot exceed 80 bytes. If val is NULL, the name of the appropri‐
ate anonymous virtual memory areas will be reset. The name can contain only printable ascii characters (is‐
print(3)), except '[', ']', '\', '$', and '`'.
```
But the sanitizer implementation does not check for null:
https://github.com/llvm/llvm-project/blob/4f8050806e14d9f7791bfaa33681cacb1ac02549/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc#L1258-L1261
So ASan incorrectly reports a SEGV on the null address for calls that intend to reset the name.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlFFv6yYUxz8NfjlqhLET2w9-yG2baVJvNy3dfY2O4SRmw2AB7l326Sdo2mZStmkIJZyTcPw_f34GQ9AnS9Sz9Re2fihwiaPzfUCKo9G2GJw69y8jwYQWZjwRKCeXiWwMrNoy_sD4lm34ZeYQ3sbPvxz2jy-Hb1-3h-3zT8-H5-3Xx7_94TL2FAEQwOJEAEfnAa2z58ktAV61jwsamGhy_gzoCcMK4BUNhNEtRsFAgDA7bSN5iA4Q7GLMXSQ_aYuRFITotT2BdDaittqebomII2UBK4CXyxIM2VMcQVtpFpVKpMownCOBRGtdBPpDEiloec4mZT8eszgd4PnXpycm7j8qgzvmNc6zd7PX7FGwlrOO35KDkf7DBfiukxgCT4HitWyJ9r1ZAGfNGWD22kYcDAFgkFoDyBE9ykg-ADDR6vCvcvJ-JtqKiS7P-9z6HIGJJoEjmpTLwcN1cH8ViPoSoFU5seFMNKubCL19fllitiyg1VH_SR70NBtK8GHUzoJyFCAdhBxJ_p7ZSWf0AeYY45wxFTsmdicdx2VYSTcxsTPm9f3rbvbuN5KRid1g3MDErj62fM1bvqGyVt2xabpyOCJW1aYtJcqhRMnFuu6Y2Ek3zdqQv_Npv9Fp-4feg3TT5OyN1CEDmyx0Pqy0lUxUT6VYt3dPpdiU1y7sHWz3aBOHznuS0ZzB0-x8DICwf_zhGzj7hlniE5XyFEI2Q6IxAeKIEdLzrEpvSAbmE_hC9ZXqqg4L6stGlF0luq4qxr5uKyWO6ohNyQca2rrqhk4MtFGtqHgnCt0LLmreiHXZ1lVZrbq2qtqyK7FpatnxhtWcJtRmlVxeOX8qdAgL9SXnG9EVBgcyIV88Qlj6DvlXJkS6h3yfj2ZYToHV3OgQw2eZqKOh_h-xSK3PXkZzdQd9sjKiVeZiVnIgFIs3_f9GJYsNTOwu3bz24q8AAAD__zuoqWY">