From patchwork Mon Feb 5 16:18:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 770119 Delivered-To: patch@linaro.org Received: by 2002:adf:8b19:0:b0:33a:e5bd:fedd with SMTP id n25csp31608wra; Mon, 5 Feb 2024 08:18:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IH40aG+Lyi0bGcQcNz+3iwXyYyhpXP0IGCO+Mm3C8V/N4bciSJYnoUTOlPCeZjaowN/NHaO X-Received: by 2002:ac8:4dc6:0:b0:42c:d9e:3316 with SMTP id g6-20020ac84dc6000000b0042c0d9e3316mr6858368qtw.4.1707149907043; Mon, 05 Feb 2024 08:18:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707149907; cv=pass; d=google.com; s=arc-20160816; b=fvOq0iQiO5u49Au9ZZ6VIfx8Z+08Uat1/ON8ILBhvZKB9LkryGhtKGFCIflpWtHu5I QNYsY0yW9SeUh1s7tuSeOEX6P4L/DIytIDkqZCvDwfNlhSOx85jQeKs59TZcfS6W9VD3 ucCSThNOiKzcGXP3lFLL9IdQ45Q3vvSqP6+rm3VHxipa0MK2CG+VlycOwNjKClS3uv0H lbi70eseA+PI3Mo5sfiJHS1jkftvFQttSo8yfAWEf/h+Bp/vss/SbI8T1hT/x2n8lHzb et/BXv9+5x9DtCbIs8V53G96UXIW+nFkpzhkOimjeQohywBeYF/wWO52XTxKClLEmCf6 FJMw== 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:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=IQ/5YsKKfFlnDpuHeKXdepg3qe1+ZnYx5wYTnT8ZAB4=; fh=EuwnqH4jzI7F/L9wGj5Ffnjzgbopp3H5ia5qHCrTLCo=; b=BQY//yStQPwlXmWT5unNqOxpXINTgt5XJ1aRIex/MYWm4YEuuvUu+h6RQAOa9zEVUn 7Sg0xVeBVyOMziuPfXfkub8ZXkezRvTUa1EntTXjIqablLoOyiPchwshKjHqTrZmdsK+ iDM4OYcqir8WRsj/XhaO3B6dqEK5CH2v9P5yBCWKCAwyAi7OvIYZf7GtGXlku2l+N04x pS5S1q0/R/NpZ3OVkAxBaZUTxghwXytrvB1niq7k8tQnWRBuwjLfJiAkbxdZlERAb8Ec /81iNZJHiFs4cEDaFoX8q1eTwW7YHsExy0xWk+C0C2NVv7yYPQCIEDtSq2j0UdGwfY4s q68A==; darn=linaro.org ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uBkz1ReW; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 X-Forwarded-Encrypted: i=1; AJvYcCUI/+j2JsYBCvy9t5gBGCxY/cWgnhyDyRypFY6inwRWJI8SjHIoCP6XhRFadKEkMj+TmC5sw0CfYuz/wM9iN59v Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t8-20020a05622a01c800b0042c0dc588f2si130960qtw.702.2024.02.05.08.18.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 08:18:27 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uBkz1ReW; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 AA7D23858012 for ; Mon, 5 Feb 2024 16:18:26 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by sourceware.org (Postfix) with ESMTPS id 8658F3858D1E for ; Mon, 5 Feb 2024 16:18:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8658F3858D1E 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 8658F3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707149897; cv=none; b=S+kI3C6/Bpxop4IXQTTjvXyzKrVitZ9aiHDypltn1+fJF1DW0BCbMAe4ZA866lXM7z2VOoD+HuvisgMC6Ia5ed7h6uvcoNRDT8wORfWVj0EWY1gasByORQpV01zp8/iWETeQ9WmxPQrpEG8KglzYgxuZ2hV8YcxCNhAHLpoDslU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707149897; c=relaxed/simple; bh=TSwbvE8RT3C4FHQBy301QNKTaxmmP5i64omNlqWPoSI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=OdQogvTg9dAfYYRDcLyRYuquQsvyc73EKF5NsXJVBLTa2yr5KL5DHMqaV+tYeIAGDNayTLJVDrB8oa/58kPxC27vTjZD808FQGmk1Gnn5F4mFw5Gs+c9e1E31lCovU5kVp3h+/+LhdHVn44edB9ZzNDIqja1U8A3OIjbVf9dkaQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-216f774c827so2309439fac.2 for ; Mon, 05 Feb 2024 08:18:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707149894; x=1707754694; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IQ/5YsKKfFlnDpuHeKXdepg3qe1+ZnYx5wYTnT8ZAB4=; b=uBkz1ReWRWW7QEIoAASGm3WEC58WLsfQPS7GWcEsBdVS2BQOnFewpglFnl3L133o33 esYQWIt40h8UARU+2QzcKzeHTnZ9v20MWZg94oBxUmLTrW2tkBmJP+7eWdmaIM+KGfAd uGoiS33u5vprdkYLLmbzfqc3N13cziDslNYeGBRcRsgRpU0Zfe7+Pdb7SJMSxXfiQWvy MUojNYtN2eUv+jxYdfdX3X+/wvkYYGKxGN+osHsJcdh4Y4BzwM7l8YtPAWkpEPScJpKF nzgcJT+HzuZEDHJph7w7hUa6eKwvqb2rO8wuDPqiAw43MXVmFJPK6eAbV5SutMFgRPIl TgxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707149894; x=1707754694; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IQ/5YsKKfFlnDpuHeKXdepg3qe1+ZnYx5wYTnT8ZAB4=; b=F6xayID50J6OSL0aokhUlfgjk1u3BkVkhs4aS2U1kZf8bGV2qrtC9Oskym16iuEVd5 rgS0C0xHmfaeej/AwpTs18TiZEEiv3F2Kj4+FIw9RaAlPh/fhX4PJILIoIYlKLlEO27G w3pcR7NSM9RqRooyipfVnp9S0rS0qWwquDnOoXwzVsRUMeRgAVx4AflXGFvYczIJDEEo NeT3P71TLeCgJPZ3WMiyEEC9TFZvG8EF1CKMN+LYkzJ0vu9ljyPBlxR+PKQ1EnyB/tzh XAWOAbv0A2G7qtWoVQpbcqccCZdsm8b3Jg4+OBuPui/ECtvVxj4uZUlw//qiPi/2dwRf 9XTg== X-Gm-Message-State: AOJu0Yw5P4gTbRHWTUo6Y7KyivBuuTgljwu6h1PjQpAYNB1Pt0VJ+XOa g71OQB8nGtO9ZS+Hrx3gtjgnnGFyeKOolJSpyEzIC9lbQYHTumJuPFET1NyV6BJCLLQpIC4e92M f X-Received: by 2002:a05:6870:420c:b0:219:432b:abca with SMTP id u12-20020a056870420c00b00219432babcamr147819oac.53.1707149893730; Mon, 05 Feb 2024 08:18:13 -0800 (PST) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id ti11-20020a056871890b00b00214d2727a8asm42969oab.25.2024.02.05.08.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 08:18:11 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Adrian Ratiu Subject: [PATCH] arm: Remove unused ldr _dl_start_user Date: Mon, 5 Feb 2024 16:18:08 +0000 Message-Id: <20240205161808.1316432-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 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=ham 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 The commit 49d877a80b29d3002887b084eec6676d9f5fec18 (arm: Remove _dl_skip_args usage) removed the _SKIP_ARGS literal, which was previously loader to r4 on loader _start. However, the cleanup did not remove the following 'ldr r4, [sl, r4]' on _dl_start_user, used to check to skip the arguments after ld self-relocations. In my testing, the kernel initially set r4 to 0, which makes the ldr instruction just read the _GLOBAL_OFFSET_TABLE_. However, since r4 is a caller-saved register; a different runtime might not zero initialize it and thus trigger an invalid memory access. Checked on arm-linux-gnu. Reported-by: Adrian Ratiu Reviewed-by: Szabolcs Nagy --- sysdeps/arm/dl-machine.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index b857bbc868..dd1a0f6b6e 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -139,7 +139,6 @@ _start:\n\ _dl_start_user:\n\ adr r6, .L_GET_GOT\n\ add sl, sl, r6\n\ - ldr r4, [sl, r4]\n\ @ save the entry point in another register\n\ mov r6, r0\n\ @ get the original arg count\n\