From patchwork Mon Nov 6 20:25:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 741458 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1294565wrr; Mon, 6 Nov 2023 12:26:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEczffso3XhE/SuQQz9ARAvnBObTGs11SVSFphwKjWN5fEMf8P46CtW2kiFhIeeQY0sDCOm X-Received: by 2002:ad4:5ca3:0:b0:66c:fcfc:9174 with SMTP id q3-20020ad45ca3000000b0066cfcfc9174mr43610899qvh.41.1699302415609; Mon, 06 Nov 2023 12:26:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699302415; cv=pass; d=google.com; s=arc-20160816; b=JLfBONO2PJMzuj9DZHNUOoSCXr/qEjUNirkOvQe3MMVufWbmycOrAUahIV9kNiTX5C +Zm8iFDIm/l+gmhj1EcfcygB5szarEyYBhq/ffrV4Knacoa0cLcVvAve68oZu22XggQm fYziS73xa34FGi9+06xqiRA1qsC8Qkk0RMdCEo19HEKUb/XIxuaudPQTJSRBGfXg5/yZ J9iPz9ZWiVynkSr8/EE5yDuqoopP8UEnFwm09qeUnP1w3SMzO70PilENR8G2Xv8pRYyQ lpbePts8AWoPUN+Ebot/XppZ7ZG/qHxr3H2yJ4EcLx7Bjo/RJ0eAVdDXPGPqfnxbqS9v MRhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=M+BOkgSs9Y+wUqYrihgJi+/5VHiKVPJu0y/LowNInKU=; fh=+FUb54tScwW7D3lvWhZcQBi30wyNNn2DusdH7ahfqKk=; b=GwYwVTS8Iphurj4cyocCFi0+39AN70bWZ5APlgNm237LnV4QHKQCy49I6FZmtVFvXu GytoTXr3S59ClmDc7tFYP9WpcFSK94amxQiXqkCyl3XtjU7NVpC8kWVc6Lfhsr4stk3+ Zqz90BgxdQHZGk4juVNSYCumKRnFuNw1lN7fTQaWpTBXpW8ZITxQzCWxuOjihzvCs2hU dRdaxzsTMZTR/aRunbwGMIIbhDOL+6N2v272KF8qcZDFMc1eSyUBge8KjTMdE2KRawhk hEcVxtSlw6BsvJQ0LOpteskyu2RPifZXRHCNLV1ycpXUm8vdHRCrqwknnt4GBt/OzBbN C8EA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="BbX/GONL"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pe16-20020a056214495000b0065af361201dsi6185380qvb.98.2023.11.06.12.26.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 12:26:55 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="BbX/GONL"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1BFE03857738 for ; Mon, 6 Nov 2023 20:26:55 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by sourceware.org (Postfix) with ESMTPS id B5BF23857C44 for ; Mon, 6 Nov 2023 20:26:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B5BF23857C44 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B5BF23857C44 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699302375; cv=none; b=KhamLaxqtSYQw6wcIhH/vsE6jrbWLqaqFN4fee8K5GWXhdlPgfzr6qydQxl72ZboXckOeCpsyzen0ffZke0sSWqN1j75cgBUMH2ouSXR1GO1rFL1gOuzQ5Uv2J0YfLu9eRZwYbUzjNh20rUufjMSlawXO52hyTXGMG7f4NY3b7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699302375; c=relaxed/simple; bh=LZUW34HABl9qwCWxOoNJ/tGUGkaAS8+rvvBq1RrvHYc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=FnE6MyGq2KAtx2Bx4qKmFBUQhnBaoUuI3kmIscmhj9k+3R9oczahpavGNf0hsHo89b1OjBFWDAZxaqJBkGSJple09QGwiVqRtnD+frYys00KGTgNtMBKH6Jg/q/x1iv7B2Q71K2UwFfe8auM8/jD+y6xNjWDIw92VQtOiVKpAfM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-5af6c445e9eso58101537b3.0 for ; Mon, 06 Nov 2023 12:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699302373; x=1699907173; 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=M+BOkgSs9Y+wUqYrihgJi+/5VHiKVPJu0y/LowNInKU=; b=BbX/GONLmTjFEVSoaxPpi986lG0FIyD2KJQb3pg4WWEffcUSBMOrQZbLUl1z9ZNefZ Li8xgiEgIZ4y937kJeJbtVptnpBn6dRV1s29yiVY9TfmtTHVWazEwDUURd4ZazXI59pw P+iEE6jguHuYJ1KZu+UtCz/rDYNraMQCF0Co/hUw6gRZWLp0Ee7c5MpndeY18CFu2Z9O rntYLcd/U8yL0TSrYafDWkAmZVbi8GkFnr/ltbLSQ9yybOo0y71C/1jSBhFBp4xQ5CKG 22WotGATDpPNTcHkRjGCkCPwmd6Tdnbw9HAP0DIDspFFwq7vVl5iRMYXevZp6mPJClkG Jqhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699302373; x=1699907173; 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=M+BOkgSs9Y+wUqYrihgJi+/5VHiKVPJu0y/LowNInKU=; b=ne6gM6KPUEFJ/HXD8g2oDQ/YZ7shnV9CaW8tWp+jyUeZGHeu507WehzipomtAHqbYF 5TyVaSADbE9ZOI6t4Cvk3MQDsNBTGJwLyZvBmInsakKkm6HgXQtKFVbmJPfb5+28QhDn NidyuhzKLZ23i3uRSdHMARG1LChv1iQW6lALgEqq7rTMrjDIDKStruj4dwbedjZnF4u8 vrcbETMucljnilYYxaoD78eW0FtqYy5XEUqkUvAIbslHEgoJwE/VfkH20aMmUtNkj8PE MVFIQuXuTn5R1mM3tNlmqYp81Sm4mbHWq0kwcph2fusWIwN3Q6b97r6Cbb638/tOGjY9 S9Hg== X-Gm-Message-State: AOJu0YwmN07h2nSL0CiTyePZhL94Jbt8tiSXTK4Fz7IcJUEBeOzH1s49 X0oYjngPJn06NzAPH7vutK0MoHh+QIQCggHjToFHhQ== X-Received: by 2002:a05:690c:c:b0:5b3:21cd:ba76 with SMTP id bc12-20020a05690c000c00b005b321cdba76mr12604544ywb.4.1699302373551; Mon, 06 Nov 2023 12:26:13 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c0:a715:c1a0:7281:6384:2ee9]) by smtp.gmail.com with ESMTPSA id ci7-20020a05690c0a8700b005a7b8fddfedsm4707154ywb.41.2023.11.06.12.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 12:26:13 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Siddhesh Poyarekar Subject: [PATCH v3 08/19] elf: Emit warning if tunable is ill-formatted Date: Mon, 6 Nov 2023 17:25:41 -0300 Message-Id: <20231106202552.3404059-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231106202552.3404059-1-adhemerval.zanella@linaro.org> References: <20231106202552.3404059-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 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, T_SCC_BODY_TEXT_LINE 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+patch=linaro.org@sourceware.org So caller knows that the tunable will be ignored. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- elf/dl-tunables.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index e1198869d6..6e3e6a2cf8 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);