[Bug 1891551] Re: (Ubuntu 16.04) automount 5.1.1 hardcoding libraries

Christian Ehrhardt  1891551 at bugs.launchpad.net
Mon Aug 17 15:55:10 UTC 2020


I really want to help you but I think I can't solve the full issue.

For the sake of being kind I checked what this flag is:

 980 /* Flag value in in the DT_FLAGS_1 .dynamic entry.  */                           
 981 #define DF_1_NOW»···0x00000001                                                   
 982 #define DF_1_GLOBAL»0x00000002                                                   
 983 #define DF_1_GROUP»·0x00000004                                                   
 984 #define DF_1_NODELETE»··0x00000008                                               
 985 #define DF_1_LOADFLTR»··0x00000010                                               
 986 #define DF_1_INITFIRST»·0x00000020                                               
 987 #define DF_1_NOOPEN»0x00000040                                                   
 988 #define DF_1_ORIGIN»0x00000080                                                   
 989 #define DF_1_DIRECT»0x00000100                                                   
 990 #define DF_1_TRANS»·0x00000200                                                   
 991 #define DF_1_INTERPOSE»·0x00000400                                               
 992 #define DF_1_NODEFLIB»··0x00000800                                               
 993 #define DF_1_NODUMP»0x00001000                                                   
 994 #define DF_1_CONFALT»···0x00002000                                               
 995 #define DF_1_ENDFILTEE»·0x00004000                                               
 996 #define»DF_1_DISPRELDNE»0x00008000                                               
 997 #define»DF_1_DISPRELPND»0x00010000                                               
 998 #define»DF_1_NODIRECT»··0x00020000                                               
 999 #define»DF_1_IGNMULDEF»·0x00040000                                               
1000 #define»DF_1_NOKSYMS»···0x00080000                                               
1001 #define»DF_1_NOHDR»·0x00100000                                                   
1002 #define»DF_1_EDITED»0x00200000                                                   
1003 #define»DF_1_NORELOC»···0x00400000                                               
1004 #define»DF_1_SYMINTPOSE»0x00800000                                               
1005 #define»DF_1_GLOBAUDIT»·0x01000000                                               
1006 #define»DF_1_SINGLETON»·0x02000000                                               
1007 #define»DF_1_STUB»··0x04000000                                                   
1008 #define»DF_1_PIE»···0x08000000  

So the assumption is that one binary is build with and one without PIE.

You'd need to fixup the lib you try to insert to match (much) better.
See also 
https://stackoverflow.com/questions/2463150/what-is-the-fpie-option-for-position-independent-executables-in-gcc-and-ld
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to autofs in Ubuntu.
https://bugs.launchpad.net/bugs/1891551

Title:
  (Ubuntu 16.04) automount 5.1.1 hardcoding libraries

Status in autofs package in Ubuntu:
  Confirmed

Bug description:
  Unable to use ld.conf methods (LD_LIBRARY_PATH, LD_PRELOAD) to locate
  modules.

  Context: HP ThinPro 7.1 Service Pack 8 (latest) is still based on Ubuntu 16.04 LTS
  Use Case: Thin Client -- HP will not allow Customers to install anything to OS
  partition, e.g. to /usr.  automount installed from Canonical's repository but to
  /usr on a flash drive e.g. /media/GenericFlash_sdb1/usr

  the string: /usr/lib/x86_64-linux-gnu/autofs appears in the binary.  automount
  does not search /media/GenericFlash_sdb1/usr defined with LD_LIBRARY_PATH.

  Source Package:
  * http://archive.ubuntu.com/ubuntu/pool/main/a/autofs/autofs_5.1.1.orig.tar.gz
  * http://archive.ubuntu.com/ubuntu/pool/main/a/autofs/autofs_5.1.1-1ubuntu3.debian.tar.xz

  Release:
  Description:    ThinPro 7.1.0
  Release:        7.1.0

  Binary Package:
  Package: autofs (5.1.1-1ubuntu3) autofs_5.1.1-1ubuntu3_amd64.deb
  * http://de.archive.ubuntu.com/ubuntu/pool/main/a/autofs/autofs_5.1.1-1ubuntu3_amd64.deb

  
  Expected Behaviour:
  Setting LD_LIBRARY_PATH=/media/GenericFlash_sdb1/usr/lib/x86_64-linux-gnu/autofs
  overriding compiled location of modules so that automount works correctly.

  Actual Behaviour:
  automount fails to find its modules:

  Code:

  # /media/GenericFlash_sdb1/usr/sbin/automount -V

  Linux automount version 5.1.1

  Directories:
          config dir:     /etc/default
          maps dir:       /etc
          modules dir:    /usr/lib/x86_64-linux-gnu/autofs

  Compile options:
    ENABLE_FORCED_SHUTDOWN ENABLE_IGNORE_BUSY_MOUNTS WITH_HESIOD 
    WITH_LDAP WITH_SASL LIBXML2_WORKAROUND 

  
  # ldd /media/GenericFlash_sdb1/usr/sbin/automount
         linux-vdso.so.1 =>  (0x00007ffc51113000)
         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1729ec8000)
         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1729cc0000)
         libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f1729900000)
         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1729530000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f172a330000)
         libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f1729198000)
         libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1728f78000)
         liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f1728d50000)
         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1728a40000)
         libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f1726f88000)
         libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1726c00000)
         libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f17269e8000)

  # LD_DEBUG=files LD_PRELOAD=/media/GenericFlash_sdb1/usr/lib/x86_64-linux-gnu/autofs/lookup_file.so /media/GenericFlash_sdb1/usr/sbin/automount -d -v -f
        9852:     WARNING: Unsupported flag value(s) of 0x8000000 in DT_FLAGS_1.
        9852:     file=/media/GenericFlash_sdb1/usr/lib/x86_64-linux-gnu/autofs/lookup_file.so [0];  needed by /media/GenericFlash_sdb1/usr/sbin/automount [0]
        9852:     file=/media/GenericFlash_sdb1/usr/lib/x86_64-linux-gnu/autofs/lookup_file.so [0];  generating link map
        9852:       dynamic: 0x00007f1737094d18  base: 0x00007f1736e68000   size: 0x000000000022f870
        9852:         entry: 0x00007f1736e70f00  phdr: 0x00007f1736e68040  phnum:                  7
        9852:
        9852:     file=libpthread.so.0 [0];  needed by /media/GenericFlash_sdb1/usr/sbin/automount [0]
        9852:     file=libpthread.so.0 [0];  generating link map
        9852:       dynamic: 0x00007f1736e5fd50  base: 0x00007f1736c48000   size: 0x000000000021c428
        9852:         entry: 0x00007f1736c4e0b0  phdr: 0x00007f1736c48040  phnum:                  9
        9852:
        9852:     file=libdl.so.2 [0];  needed by /media/GenericFlash_sdb1/usr/sbin/automount [0]
        9852:     file=libdl.so.2 [0];  generating link map
        9852:       dynamic: 0x00007f1736c42d88  base: 0x00007f1736a40000   size: 0x00000000002030f0
        9852:         entry: 0x00007f1736a40da0  phdr: 0x00007f1736a40040  phnum:                  7
        9852:
        9852:     file=libxml2.so.2 [0];  needed by /media/GenericFlash_sdb1/usr/sbin/automount [0]
        9852:     file=libxml2.so.2 [0];  generating link map
        9852:       dynamic: 0x00007f1736a37808  base: 0x00007f1736680000   size: 0x00000000003ba9b8
        9852:         entry: 0x00007f17366ad6f0  phdr: 0x00007f1736680040  phnum:                  7
        9852:
        9852:     file=libc.so.6 [0];  needed by /media/GenericFlash_sdb1/usr/sbin/automount [0]
        9852:     file=libc.so.6 [0];  generating link map
        9852:       dynamic: 0x00007f1736673ba0  base: 0x00007f17362b0000   size: 0x00000000003c99a0
        9852:         entry: 0x00007f17362d0950  phdr: 0x00007f17362b0040  phnum:                 10
        9852:
        9852:     file=libicuuc.so.55 [0];  needed by /usr/lib/x86_64-linux-gnu/libxml2.so.2 [0]
        9852:     file=libicuuc.so.55 [0];  generating link map
        9852:       dynamic: 0x00007f17362a6ae0  base: 0x00007f1735f18000   size: 0x0000000000393b20
        9852:         entry: 0x00007f1735f6d4d0  phdr: 0x00007f1735f18040  phnum:                  7
        9852:
        9852:     file=libz.so.1 [0];  needed by /usr/lib/x86_64-linux-gnu/libxml2.so.2 [0]
        9852:     file=libz.so.1 [0];  generating link map
        9852:       dynamic: 0x00007f1735f10dd0  base: 0x00007f1735cf8000   size: 0x0000000000219128
        9852:         entry: 0x00007f1735cf9db0  phdr: 0x00007f1735cf8040  phnum:                  7
        9852:
        9852:     file=liblzma.so.5 [0];  needed by /usr/lib/x86_64-linux-gnu/libxml2.so.2 [0]
        9852:     file=liblzma.so.5 [0];  generating link map
        9852:       dynamic: 0x00007f1735cf1dc0  base: 0x00007f1735ad0000   size: 0x0000000000222078
        9852:         entry: 0x00007f1735ad2090  phdr: 0x00007f1735ad0040  phnum:                  7
        9852:
        9852:     file=libm.so.6 [0];  needed by /usr/lib/x86_64-linux-gnu/libxml2.so.2 [0]
        9852:     file=libm.so.6 [0];  generating link map
        9852:       dynamic: 0x00007f1735ac7d88  base: 0x00007f17357c0000   size: 0x00000000003080f8
        9852:         entry: 0x00007f17357c5600  phdr: 0x00007f17357c0040  phnum:                  7
        9852:
        9852:     file=libicudata.so.55 [0];  needed by /usr/lib/x86_64-linux-gnu/libicuuc.so.55 [0]
        9852:     file=libicudata.so.55 [0];  generating link map
        9852:       dynamic: 0x00007f17357bddf0  base: 0x00007f1733d08000   size: 0x0000000001ab6010
        9852:         entry: 0x00007f1733d08530  phdr: 0x00007f1733d08040  phnum:                  6
        9852:
        9852:     file=libstdc++.so.6 [0];  needed by /usr/lib/x86_64-linux-gnu/libicuuc.so.55 [0]
        9852:     file=libstdc++.so.6 [0];  generating link map
        9852:       dynamic: 0x00007f1733cfad50  base: 0x00007f1733980000   size: 0x0000000000381400
        9852:         entry: 0x00007f1733a09d20  phdr: 0x00007f1733980040  phnum:                  8
        9852:
        9852:     file=libgcc_s.so.1 [0];  needed by /usr/lib/x86_64-linux-gnu/libicuuc.so.55 [0]
        9852:     file=libgcc_s.so.1 [0];  generating link map
        9852:       dynamic: 0x00007f173397d2b0  base: 0x00007f1733768000   size: 0x0000000000215910
        9852:         entry: 0x00007f173376aa70  phdr: 0x00007f1733768040  phnum:                  6
        9852:
        9852:     calling init: /lib/x86_64-linux-gnu/libpthread.so.0
        9852:     calling init: /lib/x86_64-linux-gnu/libc.so.6
        9852:     calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1
        9852:     calling init: /lib/x86_64-linux-gnu/libm.so.6
        9852:     calling init: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
        9852:     calling init: /usr/lib/x86_64-linux-gnu/libicudata.so.55
        9852:     calling init: /lib/x86_64-linux-gnu/libdl.so.2
        9852:     calling init: /lib/x86_64-linux-gnu/liblzma.so.5
        9852:     calling init: /lib/x86_64-linux-gnu/libz.so.1
        9852:     calling init: /usr/lib/x86_64-linux-gnu/libicuuc.so.55
        9852:     calling init: /usr/lib/x86_64-linux-gnu/libxml2.so.2
        9852:     calling init: /media/GenericFlash_sdb1/usr/lib/x86_64-linux-gnu/autofs/lookup_file.so
        9852:     initialize program: /media/GenericFlash_sdb1/usr/sbin/automount
        9852:     transferring control: /media/GenericFlash_sdb1/usr/sbin/automount
  Starting automounter version 5.1.1, master map /etc/auto.master
  using kernel protocol version 5.05
        9852:     file=libxml2.so [0];  dynamically loaded by /media/GenericFlash_sdb1/usr/sbin/automount [0]
        9852:     opening file=/usr/lib/x86_64-linux-gnu/libxml2.so.2 [0]; direct_opencount=1
  lookup_nss_read_master: reading master file /etc/auto.master
        9852:     file=/usr/lib/x86_64-linux-gnu/autofs/lookup_file.so [0];  dynamically loaded by /media/GenericFlash_sdb1/usr/sbin/automount [0]
  open_lookup:93: cannot open lookup module file (/usr/lib/x86_64-linux-gnu/autofs/lookup_file.so:
  cannot open shared object file: No such file or directory)
  no mounts in table

  Resolution Requested:
  If this cannot be accepted as a bug, pointers to a work around given restrictions placed by HP and that all Linux machines here are thin clients and not development environments.

  Thank you.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1891551/+subscriptions



More information about the foundations-bugs mailing list