Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 27 Jan 2018 11:42:04 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: BUG: $ORIGIN does not seem to work

On Sat, Jan 27, 2018 at 06:20:27PM +0200, Stefan Fröberg wrote:
> Hi
> 
> 
> Szabolcs Nagy kirjoitti 27.01.2018 klo 13:07:
> > * Stefan Fröberg <stefan.froberg@...roprogram.com> [2018-01-27 01:50:21 +0200]:
> >> My ldd is just symbolic link inside musl chroot environment, to
> >> /lib/ld-musl-x86_64.so.1
> >> and it's symbolic link to /lib/libc.so
> >>
> >> Here is readelf output of that test program
> >> readelf -d x
> >>
> >> Dynamic section at offset 0xe10 contains 24 entries:
> >>   Tag        Type                         Name/Value
> >>  0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.1.1]
> >                                                             ^^^^^^^^^^^^^^^^
> > this looks like the wrong library version
> >
> > if you had straced the ldd output you would have seen
> > that musl tries to open lib/libcrypto.so.1.1, but you
> > probably only have lib/libcrypto.so.1.0.0 based on the
> > glibc ldd output below.
> No, that ldd was run inside, pure, chrooted musl environment. No glibc
> inside.
> These are the only libcrypto* files inside that chroot environment:
> 
>  ls -lah /usr/lib/libcrypto.*
> -rw-r--r--    1 0        0           5.0M Dec 17 00:24 /usr/lib/libcrypto.a
> lrwxrwxrwx    1 0        0             16 Dec 17 00:24
> /usr/lib/libcrypto.so -> libcrypto.so.1.1
> -rwxr-xr-x    1 0        0           3.0M Jan 26 12:58
> /usr/lib/libcrypto.so.1.1

OK, but it still means ld picked up a different version of libcrypto
(at link time) and encoded the dependency on that different version.
You need to ensure that gcc/ld is searching your lib dir at link time.

BTW running the program itself or ldd under strace can be very
informative to see what's happening.

Rich

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ