diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-11-06 17:25:38 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-11-21 16:15:42 -0300 |
commit | b4cf6cac73725d988957410116ddf088546239ca (patch) | |
tree | cb009ca20109b9150326dc36a05bdb2cbcee237e /elf/dl-tunables.c | |
parent | 11f7e3dd8fed66e0b8740af440cd3151e55a466f (diff) | |
download | glibc-b4cf6cac73725d988957410116ddf088546239ca.tar.gz glibc-b4cf6cac73725d988957410116ddf088546239ca.tar.xz glibc-b4cf6cac73725d988957410116ddf088546239ca.zip |
elf: Do not process invalid tunable format
Tunable definitions with more than one '=' on are parsed and enabled, and any subsequent '=' are ignored. It means that tunables in the form 'tunable=tunable=value' or 'tunable=value=value' are handled as 'tunable=value'. These inputs are likely user input errors, which should not be accepted. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'elf/dl-tunables.c')
-rw-r--r-- | elf/dl-tunables.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index f7dca8f7c1..082a76d9c4 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -192,10 +192,12 @@ parse_tunables (char *valstring) const char *value = p; - while (*p != ':' && *p != '\0') + while (*p != '=' && *p != ':' && *p != '\0') p++; - if (*p == '\0') + if (*p == '=') + break; + else if (*p == '\0') done = true; else *p++ = '\0'; |