From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51298388A407; Thu, 11 Mar 2021 12:58:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51298388A407 From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT Date: Thu, 11 Mar 2021 12:58:56 +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.24 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 2.25 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, 11 Mar 2021 12:58:57 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D20019 --- Comment #29 from H.J. Lu --- (In reply to yangyanchao6@huawei.com from comment #28) > [root@localhost DTS2021030805K7VLP1D00]# gcc -O2 -c -o main.o main.c > [root@localhost DTS2021030805K7VLP1D00]# gcc -O2 -fPIC -c -o foo.o foo.c > [root@localhost DTS2021030805K7VLP1D00]# gcc -O2 -fPIC -c -o bar.o bar.c > [root@localhost DTS2021030805K7VLP1D00]# ld.gold -shared -z now -o > libbar.so bar.o > [root@localhost DTS2021030805K7VLP1D00]# ld.gold -shared -z now -o > libfoo.so foo.o libbar.so Never use ld directly unless you know what you are getting. > [root@localhost DTS2021030805K7VLP1D00]# gcc -o foo main.o libfoo.so > -Wl,-rpath,.=20 > [root@localhost DTS2021030805K7VLP1D00]# ./foo=20 > ./foo: Relink `./libbar.so' with `/usr/lib64/libc.so.6' for IFUNC symbol > `memmove' > Segmentation fault (core dumped) > [root@localhost DTS2021030805K7VLP1D00]# readelf -r libbar.so >=20 > --=20 You are receiving this mail because: You are on the CC list for the bug.=