From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A9EEA383F86B; Thu, 25 Jun 2020 15:39:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9EEA383F86B From: "fweimer at redhat dot com" 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:39:46 +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: fweimer at redhat dot com 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: 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:39:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23293 --- Comment #5 from Florian Weimer --- (In reply to Szabolcs Nagy from comment #4) > (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 stor= es > > the address if auxv entries, only values read from the vector. >=20 > it may work, but i think _dl_start_user stack handling should > not be updated, it should be removed: the logic is backwards: >=20 > 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). >=20 > this would also fix the (imo security) bug that the protection > of dl data is not consistent across targets (DL_ARGV_NOT_RELRO). >=20 > 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. >=20 > i didnt get the chance to clean this up yet, so it's not fixed. That sounds of course very reasonable. As long as very manipulate the argum= ents as arrays, the C code should be very portable. An assembler stub will still= be needed, but it will be much smaller. I also think we should move the assembler code out of dl-machine.h while we= are at it. We can start out with an empty dl-start.S file, and gradually move p= orts to follow the powerpc32 example. --=20 You are receiving this mail because: You are on the CC list for the bug.=