NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/49813: dladdr on non-existent address may cause a deadlock
>Number: 49813
>Category: lib
>Synopsis: dladdr on non-existent address may cause a deadlock
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 04 17:15:00 +0000 2015
>Originator: Stas
>Release: 6.1.6
>Organization:
>Environment:
>Description:
In the dladdr function in
http://cvsweb.netbsd.org/bsdweb.cgi/src/libexec/ld.elf_so/rtld.c?rev=1.173.4.1&content-type=text/x-cvsweb-markup
(can't figure out how to link to a specific line, here's a github link: https://github.com/jsonn/src/blob/c44251ea512cf59e9825553cb119f9eeeacfd250/libexec/ld.elf_so/rtld.c#L1270-1272 )
presumably, it should be lookup_mutex_exit, not _enter, otherwise it will cause a deadlock.
>How-To-Repeat:
#include <dlfcn.h>
#include <stdlib.h>
int main ()
{
Dl_info dlinfo;
dladdr(1234, &dlinfo);
exit(0);
}
=>
#0 0x00007f7ff7c0d51a in ___lwp_park50 () from /usr/libexec/ld.elf_so
#1 0x00007f7ff7c0582c in _rtld_exclusive_enter () from /usr/libexec/ld.elf_so
#2 0x00007f7ff7c06dae in _rtld_exit () from /usr/libexec/ld.elf_so
#3 0x00007f7ff78cc0e7 in __cxa_finalize () from /usr/lib/libc.so.12
#4 0x00007f7ff78cbe3e in exit () from /usr/lib/libc.so.12
#5 0x000000000040095f in main ()
>Fix:
Home |
Main Index |
Thread Index |
Old Index