Commit 7e22f99
committed
[lldb] Fix a use-after-free in SymbolFileCTF
This fixes a use-after-free in SymbolFileCTF. Previously, we would
remove the underlying CTF type as soon as we resolved it. However, it's
possible that we're still holding onto the CTF type while we're parsing
a dependent type, like a modifier, resulting in a use-after-free. This
patch addresses the issue by delaying the removal of the CTF type until
the type is fully resolved.
I have a XNU kernel binary that reproduces the issue and confirmed that
this solves the memory issue using ASan. However I haven't been able to
craft types by hand that reproduce this issue for a test case.
rdar://1566608661 parent 7cdc978 commit 7e22f99
1 file changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
| 741 | + | |
742 | 742 | | |
743 | 743 | | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
744 | 764 | | |
745 | 765 | | |
746 | 766 | | |
| |||
994 | 1014 | | |
995 | 1015 | | |
996 | 1016 | | |
| 1017 | + | |
| 1018 | + | |
997 | 1019 | | |
998 | 1020 | | |
999 | 1021 | | |
| |||
1015 | 1037 | | |
1016 | 1038 | | |
1017 | 1039 | | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | 1040 | | |
1024 | 1041 | | |
1025 | 1042 | | |
| |||
0 commit comments