From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id C8A283858D1E for ; Mon, 5 Feb 2024 18:19:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8A283858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C8A283858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707157195; cv=none; b=PQddzu3n15R0qhdO5IbmLibSdZi4CX6WcE8eX2uB2un8TxODU7I9bHUxwaG7c/OO3NQCWU9IahGxenFDpLuLKmr4z4uco/yYDi+Qg1ipks+9A82IODxnksi0wGn409M+vslwN02dr0E6mDT6TKMoti9BXSwIDh0IvmLq07HE0Uw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707157195; c=relaxed/simple; bh=H6LU7ntI2OoCpqCqVYAeJjJixrxH7wLV/BBWf3LTgi0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=CA9hVwt9/i9vxinmH7Eb18WPTvu82fU5LhZN4CMPvI7EJhZP2jSpPTI/f6j4DLSfSX25i/JaWRBlVMlAeczA8A8iBRqKgZX2seT/jMwcO3mQ4e9V5Il3Ro1uuGxMcTXlZg4D9lZVCOgOUQuSvL9r9PJD40fFxBw+4wk4AN2Z9Y0= ARC-Authentication-Results: i=1; server2.sourceware.org References: <20240205161808.1316432-1-adhemerval.zanella@linaro.org> <87bk8ual6f.fsf@gentoo.org> <53d1dad6-4506-4ff9-9d1e-0c4125ad8726@linaro.org> User-agent: mu4e 1.10.8; emacs 30.0.50 From: Sam James To: Adhemerval Zanella Netto Cc: Sam James , Adrian Ratiu , libc-alpha@sourceware.org Subject: Re: [PATCH] arm: Remove unused ldr _dl_start_user Date: Mon, 05 Feb 2024 18:19:45 +0000 Organization: Gentoo In-reply-to: <53d1dad6-4506-4ff9-9d1e-0c4125ad8726@linaro.org> Message-ID: <874jemai4a.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,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 List-Id: Adhemerval Zanella Netto writes: > On 05/02/24 14:13, Sam James wrote: >> >> Adhemerval Zanella writes: >> >>> 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. >> >> Tag the bug? >> >> Also, I feel like the title perhaps makes the change sound more cosmetic >> than it is. > > Right, I will change to 'arm: Remove wrong ldr _dl_start_user (BZ 31339)' wfm, thanks! > >> >>> >>> Checked on arm-linux-gnu. >>> >>> Reported-by: Adrian Ratiu >>> --- >>> 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\ >>