From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 1BD61385842A; Tue, 21 Nov 2023 20:49:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BD61385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700599747; bh=plcQkSSBxJzsglIiLh0kE0L79IcEu4D3qopmhaiKnqA=; h=From:To:Subject:Date:From; b=V3bjfvJ6APVGMn4O951MCDGaCelCSzzmNHG38+xyLrHJJRMJ6liJJVuk0Cy3H79/U 6Ly4Dtuiq7vtoitSInJxoa/Q+ybMpqfF5N3hWIh3hSvYWn3uSO2S+VLFiaIPraPEF+ 8+PJG8YJ0s3dADlukvKftcqT+/far42PP7LV9wKI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] elf: Emit warning if tunable is ill-formatted X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 434eca873f14f618d6c2279b54fb809fb56f2c50 X-Git-Newrev: eb9291aaa6ff6af158a1436b881ef8b834559621 Message-Id: <20231121204907.1BD61385842A@sourceware.org> Date: Tue, 21 Nov 2023 20:49:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eb9291aaa6ff6af158a1436b881ef8b834559621 commit eb9291aaa6ff6af158a1436b881ef8b834559621 Author: Adhemerval Zanella Date: Mon Nov 6 17:25:41 2023 -0300 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 Diff: --- elf/dl-tunables.c | 6 ++++++ 1 file changed, 6 insertions(+) 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);