From patchwork Tue Oct 10 18:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 77436 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0136F389367D for ; Tue, 10 Oct 2023 18:02:55 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 29220385C6DD for ; Tue, 10 Oct 2023 18:01:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29220385C6DD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c9bf22fe05so5606655ad.2 for ; Tue, 10 Oct 2023 11:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696960895; x=1697565695; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/tMmjbNjay8l9Ar1cNsfbmGb8/lVFJEUoNGaSUe8Ee0=; b=Q0AED1nj0rOVChmlf9yD826cA+rIuX13S5PDcyTkeBi3UJ1QvaS6i/kQIVbfszf5Gv CefSLTJYJ6opZreJtUfeoDVIqg/d7SNCP8OfzmJYcaYIm6UuHH2ilipXP/ifI6C4/JQs NRsXp4Ot4gNVZNDyW4I5omSiH11KWGnsJ7oGww8+ngA+RFYMywOkxc5iTZT6UQUlO/am U+vSM8tWqndwoZMzeEpSCWP2OVjUbQJ9JJBpeHkKJNWCwZHBpfZyMUjNDzi36ErYGiaU vEjEzj6OnwJ98+8iw/jV+m7gQzhU8NGW3V6dXC1MxR0ejDe2qflafcij9BDSWbiwHpLK cyBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696960895; x=1697565695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/tMmjbNjay8l9Ar1cNsfbmGb8/lVFJEUoNGaSUe8Ee0=; b=gohlMwJX12lTUTIGHP8RXygbILFTdvZo/CjlRsvheUIs/blgX/f738zr0PDaFzqwIP rkN5lABvFKN2kSfCtjGSTc1KwMBd3i48NKfwrIoy00OmsKTRWn1/NspNf9nj2vQgBi+N VsSc7oZAseejaQJ7g4aiXt1JN1XKsdS4dluyWzPuKb7WZfftk1Iky5VTspZV0xr+I+RC Z/VH9PX2WeCiaCPaP7KrVHT28J6jywqsawbiIEoMxHd9E9n1OLu2ir2n2icBBoYVuY7j h5H8t3A2I6EBpmH9YTIBKzcFd/H8187upXXJVHm7kItno1ol5mJATWQbJiLmxOIclwqo qi1g== X-Gm-Message-State: AOJu0YzR+vTaiEY9WhgkHq2t/MYnOLXz6KRAa7mfjQmWfx/lTdFUTmQO yAyiwGbG/a+RfAXBVoCb/2cohkqYGDXV4cmjULajNw== X-Google-Smtp-Source: AGHT+IEYCk0eyPQ734FlbVir0AvaPH2x3A/E36RgQdgmybj1J7k/MhDnMJXX1R+TBbRe7h2dbgTLZg== X-Received: by 2002:a17:903:246:b0:1c0:b84d:3f73 with SMTP id j6-20020a170903024600b001c0b84d3f73mr18725092plh.53.1696960894698; Tue, 10 Oct 2023 11:01:34 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:d09b:ef2e:7c42:5ecf:a4ef]) by smtp.gmail.com with ESMTPSA id 5-20020a170902c24500b001bb9d6b1baasm12088022plg.198.2023.10.10.11.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 11:01:33 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Siddhesh Poyarekar Subject: [PATCH 08/11] elf: Emit warning if tunable is ill-formatted Date: Tue, 10 Oct 2023 15:01:08 -0300 Message-Id: <20231010180111.561793-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010180111.561793-1-adhemerval.zanella@linaro.org> References: <20231010180111.561793-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org So caller knows that the tunable will be ignored. Checked on x86_64-linux-gnu. --- elf/dl-tunables.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index 5d4b8c5bc0..b39c14694c 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -236,7 +236,11 @@ parse_tunables (char *valstring) struct tunable_toset_t tunables[tunables_list_size]; int ntunables = parse_tunables_string (valstring, tunables); if (ntunables == -1) - return; + { + _dl_error_printf ( + "ERROR: 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);