<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76957>76957</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libunwind]
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SihangZhu
</td>
</tr>
</table>
<pre>
In libgcc, we register the eh_frame section of the live patching. We can use the `__register_frame` interface. This libunwind library also provides` __register_frame` and `__deregister_frame` functions, but they are aliases for `__unw_add_dynamic_fde` and `__unw_remove_dynamic_fde` and thus can only take a single FDE. I found the `__unw_add_dynamic_eh_frame_section` function, but during live patching, the eh_frame section may be followed by all 0. Scenario, the content of all 0 will be regarded as legal CIE.
We will fall into an infinite loop or access illegal memory.
the data of patchArea as below
![image](https://github.com/llvm/llvm-project/assets/153892168/e623900d-61d4-4008-b788-34b3b6d013c5)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU71u2zAQfhpqOVigqP9BQxLHQOYUCNDFOIkniS1FGiRlw29fUI7bBvXSyYbu-7uPOPReTYaoY-UzK_cJrmG2rntXM5rp-7wmvZXX7s2AVv00DEy8wIXA0aR8IAdhJqD5ODpcCDwNQVkDdty-a3UmOGEYZmWmFD4IBjSwetqmrOLH413nJsAqDsoEciMOlMK3Wflou5qLMjL-c-iugNpbODl7VpJ8pDySQSNvDpL-HY6r2YL6uE2_hpjnCugIUCv05GG07kZfzeWIUh7l1eCihuMov8rHuaPFnukRJMyr35a2Rl8h4E8CBK_MpAkO-9cU3mC06wakx373bo-f3f4d_55erk6Z6WvdcfbwbRa8Qk8wWq3thST0sVANPIX3gQw6ZSN14w7WBDIhPucGgYvSOpIdTegkSUAPmibU8PL2mjK-Z_zpg26wMVKUCRbQgDKjMioQaGtPYB3gMJD3oPSNvtBi3fVTIVpLDBh9t3WeHGG06knbyw3DRMbKZ7XgRKzcM9HMIZw8y5-YODBxmFSY1z4d7MLEQevz_Wd3cvYHDYGJA3pPwTNxyMq8aUVWNUwcqBJ5y7ncVZksdgXnza6vm2aXF33eV5Jn-VAy0d4yJLLLZZu3mFCX1bzI65qXTTJ3PaeyzFteN0WDUmZtLtqhGXnP2zoveZOoTnBR8IwXWcGLrEmbqqnbNpNFllHJsWAFpwWVTmPo1LopUd6v1NVVW9aJxp603w5WCEMX2IZMiHi_rtsW7dfJs4Jr5YP_oxJU0Nul_76qSFmd7v67v80z9rdl-hUAAP__h3dp9A">