From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E29B538708A8; Thu, 25 Jun 2020 15:34:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E29B538708A8 From: "nsz at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/23293] aarch64: getauxval is broken when run as ld.so ./exe and ld.so adjusts argv on the stack Date: Thu, 25 Jun 2020 15:34:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.27 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nsz at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 15:34:43 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23293 Szabolcs Nagy changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nsz at gcc dot gnu.org --- Comment #4 from Szabolcs Nagy --- (In reply to Florian Weimer from comment #3) > (In reply to Michael Hudson-Doyle from comment #2) > > I've just run into this because it causes a glibc test failure when > > libnss-systemd is enabled > > (https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1869364). > >=20 > > Would a fix be for _dl_start_user to update _dl_auxv in the same way it > > updates _dl_argv? Or is that just naive (start up code confuses me!) >=20 > I think this should work. There does not seems to be anything that stores > the address if auxv entries, only values read from the vector. it may work, but i think _dl_start_user stack handling should not be updated, it should be removed: the logic is backwards: most targets have fragile asm for the rtld start code to shuffle around entries on the stack, but such shuffling can be done in c in the generic code (e.g. in dl_main). this would also fix the (imo security) bug that the protection of dl data is not consistent across targets (DL_ARGV_NOT_RELRO). and all this mess is for saving a few cycles on targets where you don't need to do the shuffling. i think the generic code should work for all targets and those who wish to optimize add some hacks (e.g. ifdef out the shuffling), not the other way around. i didnt get the chance to clean this up yet, so it's not fixed. --=20 You are receiving this mail because: You are on the CC list for the bug.=