public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
@ 2020-12-28 13:11 ` hjl.tools at gmail dot com
  2020-12-28 13:16 ` hjl.tools at gmail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2020-12-28 13:11 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

--- Comment #22 from H.J. Lu <hjl.tools at gmail dot com> ---
Here is another testcase:

https://sourceware.org/pipermail/libc-alpha/2020-December/121118.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
  2020-12-28 13:11 ` [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT hjl.tools at gmail dot com
@ 2020-12-28 13:16 ` hjl.tools at gmail dot com
  2021-01-13 20:17 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2020-12-28 13:16 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #23 from H.J. Lu <hjl.tools at gmail dot com> ---
It can also happen when IFUNC resolver is defined in executable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
  2020-12-28 13:11 ` [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT hjl.tools at gmail dot com
  2020-12-28 13:16 ` hjl.tools at gmail dot com
@ 2021-01-13 20:17 ` hjl.tools at gmail dot com
  2021-01-13 23:28 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2021-01-13 20:17 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW

--- Comment #24 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for 2.33 by

commit 6ea5b57afa5cdc9ce367d2b69a2cebfb273e4617
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Dec 28 05:28:49 2020 -0800

    x86: Check IFUNC definition in unrelocated executable [BZ #20019]

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-01-13 20:17 ` hjl.tools at gmail dot com
@ 2021-01-13 23:28 ` hjl.tools at gmail dot com
  2021-03-11  2:34 ` yangyanchao6 at huawei dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2021-01-13 23:28 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #25 from H.J. Lu <hjl.tools at gmail dot com> ---
Also fixed on 2.32/2.31/2.30/2.29/2.28 branches.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-01-13 23:28 ` hjl.tools at gmail dot com
@ 2021-03-11  2:34 ` yangyanchao6 at huawei dot com
  2021-03-11  3:07 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: yangyanchao6 at huawei dot com @ 2021-03-11  2:34 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

yangyanchao6 at huawei dot com <yangyanchao6 at huawei dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yangyanchao6 at huawei dot com

--- Comment #26 from yangyanchao6 at huawei dot com <yangyanchao6 at huawei dot com> ---
(In reply to H.J. Lu from comment #24)
> Fixed for 2.33 by
> 
> commit 6ea5b57afa5cdc9ce367d2b69a2cebfb273e4617
> Author: H.J. Lu <hjl.tools@gmail.com>
> Date:   Mon Dec 28 05:28:49 2020 -0800
> 
>     x86: Check IFUNC definition in unrelocated executable [BZ #20019]

I tried this patch but the problem didn't get fixed.
Is there anything else I need to do?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-03-11  2:34 ` yangyanchao6 at huawei dot com
@ 2021-03-11  3:07 ` hjl.tools at gmail dot com
  2021-03-11  6:24 ` yangyanchao6 at huawei dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2021-03-11  3:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

--- Comment #27 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to yangyanchao6@huawei.com from comment #26)
> (In reply to H.J. Lu from comment #24)
> > Fixed for 2.33 by
> > 
> > commit 6ea5b57afa5cdc9ce367d2b69a2cebfb273e4617
> > Author: H.J. Lu <hjl.tools@gmail.com>
> > Date:   Mon Dec 28 05:28:49 2020 -0800
> > 
> >     x86: Check IFUNC definition in unrelocated executable [BZ #20019]
> 
> I tried this patch but the problem didn't get fixed.
> Is there anything else I need to do?

What problem did you run into?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-03-11  3:07 ` hjl.tools at gmail dot com
@ 2021-03-11  6:24 ` yangyanchao6 at huawei dot com
  2021-03-11 12:58 ` hjl.tools at gmail dot com
  2023-11-24  7:24 ` fweimer at redhat dot com
  8 siblings, 0 replies; 9+ messages in thread
From: yangyanchao6 at huawei dot com @ 2021-03-11  6:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

--- Comment #28 from yangyanchao6 at huawei dot com <yangyanchao6 at huawei dot com> ---
(In reply to H.J. Lu from comment #27)
> (In reply to yangyanchao6@huawei.com from comment #26)
> > (In reply to H.J. Lu from comment #24)
> > > Fixed for 2.33 by
> > > 
> > > commit 6ea5b57afa5cdc9ce367d2b69a2cebfb273e4617
> > > Author: H.J. Lu <hjl.tools@gmail.com>
> > > Date:   Mon Dec 28 05:28:49 2020 -0800
> > > 
> > >     x86: Check IFUNC definition in unrelocated executable [BZ #20019]
> > 
> > I tried this patch but the problem didn't get fixed.
> > Is there anything else I need to do?
> 
> What problem did you run into?

[root@localhost DTS2021030805K7VLP1D00]# cat bar.c 
void
bar (void *dst, void *src)
{
  __builtin_memmove (dst, src, 40);
}
[root@localhost DTS2021030805K7VLP1D00]# cat foo.c 
void bar (void *dst, void *src);

void
foo (void)
{
  char dst[50];
  char src[50];
  bar (dst, src);
}
[root@localhost DTS2021030805K7VLP1D00]# cat main.c 
void foo (void);

int
main ()
{
  foo ();
  return 0;
}
[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
[root@localhost DTS2021030805K7VLP1D00]# gcc -o foo main.o libfoo.so
-Wl,-rpath,. 
[root@localhost DTS2021030805K7VLP1D00]# ./foo 
./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

Relocation section '.rela.plt' at offset 0x2b0 contains 1 entry:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
000000001ff8  000100000007 R_X86_64_JUMP_SLO 0000000000000000 memmove + 0

It looks the same as it did before the patch was incorporated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-03-11  6:24 ` yangyanchao6 at huawei dot com
@ 2021-03-11 12:58 ` hjl.tools at gmail dot com
  2023-11-24  7:24 ` fweimer at redhat dot com
  8 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2021-03-11 12:58 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

--- Comment #29 from H.J. Lu <hjl.tools at gmail dot com> ---
(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,. 
> [root@localhost DTS2021030805K7VLP1D00]# ./foo 
> ./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
> 
>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
       [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2021-03-11 12:58 ` hjl.tools at gmail dot com
@ 2023-11-24  7:24 ` fweimer at redhat dot com
  8 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2023-11-24  7:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20019

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=31083

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-24  7:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-20019-131@http.sourceware.org/bugzilla/>
2020-12-28 13:11 ` [Bug dynamic-link/20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT hjl.tools at gmail dot com
2020-12-28 13:16 ` hjl.tools at gmail dot com
2021-01-13 20:17 ` hjl.tools at gmail dot com
2021-01-13 23:28 ` hjl.tools at gmail dot com
2021-03-11  2:34 ` yangyanchao6 at huawei dot com
2021-03-11  3:07 ` hjl.tools at gmail dot com
2021-03-11  6:24 ` yangyanchao6 at huawei dot com
2021-03-11 12:58 ` hjl.tools at gmail dot com
2023-11-24  7:24 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).