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 Netto X-Patchwork-Id: 1860454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=BbX/GONL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SPNDk3MQyz1yQ5 for ; Tue, 7 Nov 2023 07:27:02 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C16D4385B522 for ; Mon, 6 Nov 2023 20:26:59 +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-Google-Smtp-Source: AGHT+IEWSe/dSEl5mDHSO/ooctdMjqSmxGHsEuoyxUwH5exJXXzNAV/c7BWouafRgQFGIjR1YCbGog== 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+incoming=patchwork.ozlabs.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);