Bug 13945

Summary: RUNPATH behaviour is not transitive
Product: glibc Reporter: Dimitri <mitya>
Component: dynamic-linkAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: normal CC: roland, rsa, walters
Priority: P2 Flags: fweimer: security-
Version: 2.15   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Dimitri 2012-04-04 19:55:27 UTC
If only DT_RPATH is used, the DSO chain is traced up to the root (normally an executable), and thus DT_RPATH of the root module is honoured. With DT_RUNPATH, it is not; see _dl_map_object in elf/dl-load.c.

That's why if DT_RUNPATH is present, indirect DSO loading from a non-standard path won't work, for example, if using GModule from GLib. (Even if the correct DT_RPATH is present, it will be overridden and invalidated by DT_RUNPATH.)

GNOME bug #670477 is an example of such situation. In order to make shell extensions load, we need to make sure that the "--enable-new-dtags" ld flag is not used.

Comment 2 Ryan S. Arnold 2012-05-22 15:02:16 UTC
It's unfortunate that RPATH is supposedly deprecated in favor of DT_RUNPATH.  And DT_RUNPATH was created to allow LD_LIBRARY_PATH to override the -rpath setting, and yet setting LD_LIBRARY_PATH is widely vilified.  I guess this leaves changing ld.so.conf, but that takes root permission.

Roland will you comment please?