Skip to content

Commit 2f4f5af

Browse files
committed
fix: missing vdso lead to unoperating SoList hiding
This commit fixes the issue where the could would return when "__dl__ZL4vdso*" wasn't found, leaving traces in SoList.
1 parent a4c9794 commit 2f4f5af

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

loader/src/injector/solist.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,17 @@ static bool solist_init() {
9393
See #63 for more information.
9494
*/
9595
solist = (SoInfo *)getSymbValueByPrefix(linker, "__dl__ZL6solist");
96-
if (solist == NULL) {
96+
if ((void *)solist == NULL) {
9797
LOGE("Failed to find solist __dl__ZL6solist*");
9898

9999
ElfImg_destroy(linker);
100100

101101
return false;
102102
}
103103

104+
LOGD("%p is solist", (void *)solist);
105+
104106
somain = (SoInfo *)getSymbValueByPrefix(linker, "__dl__ZL6somain");
105-
LOGI("%p is somain", (void *)somain);
106107
if (somain == NULL) {
107108
LOGE("Failed to find somain __dl__ZL6somain*");
108109

@@ -111,6 +112,8 @@ static bool solist_init() {
111112
return false;
112113
}
113114

115+
LOGD("%p is somain", (void *)somain);
116+
114117
sonext = (SoInfo **)getSymbAddressByPrefix(linker, "__dl__ZL6sonext");
115118
if (sonext == NULL) {
116119
LOGE("Failed to find sonext __dl__ZL6sonext*");
@@ -120,14 +123,10 @@ static bool solist_init() {
120123
return false;
121124
}
122125

123-
SoInfo *vdso = (SoInfo *)getSymbValueByPrefix(linker, "__dl__ZL4vdso");
124-
if (vdso == NULL) {
125-
LOGE("Failed to find vsdo __dl__ZL4vdso*");
126-
127-
ElfImg_destroy(linker);
126+
LOGD("%p is sonext", (void *)sonext);
128127

129-
return false;
130-
}
128+
SoInfo *vdso = (SoInfo *)getSymbValueByPrefix(linker, "__dl__ZL4vdso");
129+
if (vdso != NULL) LOGD("%p is vdso", (void *)vdso);
131130

132131
get_realpath_sym = (const char *(*)(SoInfo *))getSymbAddress(linker, "__dl__ZNK6soinfo12get_realpathEv");
133132
if (get_realpath_sym == NULL) {
@@ -138,6 +137,8 @@ static bool solist_init() {
138137
return false;
139138
}
140139

140+
LOGD("%p is get_realpath", (void *)get_realpath_sym);
141+
141142
soinfo_free = (void (*)(SoInfo *))getSymbAddressByPrefix(linker, "__dl__ZL11soinfo_freeP6soinfo");
142143
if (soinfo_free == NULL) {
143144
LOGE("Failed to find soinfo_free __dl__ZL11soinfo_freeP6soinfo*");
@@ -147,6 +148,8 @@ static bool solist_init() {
147148
return false;
148149
}
149150

151+
LOGD("%p is soinfo_free", (void *)soinfo_free);
152+
150153
g_module_load_counter = (uint64_t *)getSymbAddress(linker, "__dl__ZL21g_module_load_counter");
151154
if (g_module_load_counter != NULL) LOGD("found symbol g_module_load_counter");
152155

0 commit comments

Comments
 (0)