about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-11-06 17:25:41 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-11-21 16:15:42 -0300
commiteb9291aaa6ff6af158a1436b881ef8b834559621 (patch)
tree152aae3da0fbd7c30b6df0910360060ee3ebc6af /elf
parent434eca873f14f618d6c2279b54fb809fb56f2c50 (diff)
downloadglibc-eb9291aaa6ff6af158a1436b881ef8b834559621.tar.gz
glibc-eb9291aaa6ff6af158a1436b881ef8b834559621.tar.xz
glibc-eb9291aaa6ff6af158a1436b881ef8b834559621.zip
elf: Emit warning if tunable is ill-formatted
So caller knows that the tunable will be ignored.

Checked on x86_64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-tunables.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index 4d6a143f06..83265bc00b 100644
--- a/elf/dl-tunables.c
+++ b/elf/dl-tunables.c
@@ -235,6 +235,12 @@ parse_tunables (char *valstring)
 {
   struct tunable_toset_t tunables[tunables_list_size];
   int ntunables = parse_tunables_string (valstring, tunables);
+  if (ntunables == -1)
+    {
+      _dl_error_printf (
+        "WARNING: ld.so: invalid GLIBC_TUNABLES `%s': ignored.\n", valstring);
+      return;
+    }
 
   for (int i = 0; i < ntunables; i++)
     tunable_initialize (tunables[i].t, tunables[i].value);