From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E5CB93858C41; Sat, 1 Jul 2023 08:40:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5CB93858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688200813; bh=oZBV/5bG5qh0xKZnyicteK1MYZ4oxeOdHmmRkDhCPi8=; h=From:To:Subject:Date:From; b=YCK9Wjl9F48+JQZMNo9JlswOh1QYNZak1JYcglLdu2BL72YJ1cldZbUx6kDMXIkFD P6EGs/aKIOUEyivrqPD9yw8OexL3TmxqKf+0nHmqiAkrfiMsDOSmeqOxcu1udzbHI3 yMFVwxIOhxipFiNI9UBh9wcGBeQn486kZb0QU2h8= From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/30601] New: ld.so should not use argv[0] as the dynamic linker name Date: Sat, 01 Jul 2023 08:40:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone flagtypes.name Message-ID: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30601 Bug ID: 30601 Summary: ld.so should not use argv[0] as the dynamic linker name Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: dynamic-link Assignee: unassigned at sourceware dot org Reporter: fweimer at redhat dot com Target Milestone: --- Flags: security- Without an explicit loader invocation, the program name (in argv[0]) does n= ot matter for dynamic linking because it always set to "". But with an explicit invocation, argv[0] ends up as an alias for the dynamic linker itself: $ (exec -a libc.so.6 ld.so /usr/bin/cat) /usr/bin/cat: libc.so.6: version `GLIBC_2.33' not found (required by /usr/bin/cat) /usr/bin/cat: libc.so.6: version `GLIBC_2.16' not found (required by /usr/bin/cat) /usr/bin/cat: libc.so.6: version `GLIBC_2.3.4' not found (required by /usr/bin/cat) /usr/bin/cat: libc.so.6: version `GLIBC_2.27' not found (required by /usr/bin/cat) This can be seen by attaching a debugger and inspecting l_name for the load= er map: $ (exec -a foo ld.so /usr/bin/cat) $ gdb -p `pgrep ld.so` (gdb) print _rtld_global._dl_rtld_map.l_name $1 =3D 0x7ffe23a123b6 "foo" (The pldd command does not work in this context, see bug 30600.) --=20 You are receiving this mail because: You are on the CC list for the bug.=