1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

elf: Make glibc.rtld.enable_secure ignore alias environment variables

Tunable with environment variables aliases are also ignored if
glibc.rtld.enable_secure is enabled.  The tunable parsing is also
optimized a bit, where the loop that checks each environment variable
only checks for the tunables with aliases instead of all tables.

Checked on aarch64-linux-gnu and x86_64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Adhemerval Zanella
2024-05-06 13:18:48 -03:00
parent 1e1ad714ee
commit eb59c7b43d
3 changed files with 165 additions and 25 deletions

View File

@ -156,7 +156,7 @@ END {
print "# define TUNABLE_ALIAS_MAX " (max_alias_len + 1)
print "# include \"dl-tunable-types.h\""
# Finally, the tunable list.
print "static tunable_t tunable_list[] attribute_relro = {"
print "static tunable_t tunable_list[] attribute_relro __attribute_used__ = {"
for (tnm in types) {
split (tnm, indices, SUBSEP);
t = indices[1];
@ -168,5 +168,19 @@ END {
default_val[t,n,m], env_alias[t,n,m]);
}
print "};"
# Map of tunable with environment variables aliases used during parsing. */
print "\nstatic const tunable_id_t tunable_env_alias_list[] ="
printf "{\n"
for (tnm in types) {
split (tnm, indices, SUBSEP);
t = indices[1];
n = indices[2];
m = indices[3];
if (env_alias[t,n,m] != "{0}") {
printf (" TUNABLE_ENUM_NAME(%s, %s, %s),\n", t, n, m);
}
}
printf "};\n"
print "#endif"
}