mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-26 20:51:11 +00:00
aarch64: Fix missing BTI protection from dependencies [BZ #26926]
The _dl_open_check and _rtld_main_check hooks are not called on the dependencies of a loaded module, so BTI protection was missed on every module other than the main executable and directly dlopened libraries. The fix just iterates over dependencies to enable BTI. Fixes bug 26926.
This commit is contained in:
parent
6f19927b98
commit
72739c79f6
@ -51,11 +51,24 @@ enable_bti (struct link_map *map, const char *program)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable BTI for L if required. */
|
/* Enable BTI for L and its dependencies. */
|
||||||
|
|
||||||
void
|
void
|
||||||
_dl_bti_check (struct link_map *l, const char *program)
|
_dl_bti_check (struct link_map *l, const char *program)
|
||||||
{
|
{
|
||||||
if (GLRO(dl_aarch64_cpu_features).bti && l->l_mach.bti)
|
if (!GLRO(dl_aarch64_cpu_features).bti)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (l->l_mach.bti)
|
||||||
enable_bti (l, program);
|
enable_bti (l, program);
|
||||||
|
|
||||||
|
unsigned int i = l->l_searchlist.r_nlist;
|
||||||
|
while (i-- > 0)
|
||||||
|
{
|
||||||
|
struct link_map *dep = l->l_initfini[i];
|
||||||
|
if (dep->l_init_called)
|
||||||
|
continue;
|
||||||
|
if (dep->l_mach.bti)
|
||||||
|
enable_bti (dep, program);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user