This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 9733
  Multiple dynamic linker (RTLD) audit libraries fails Last modified: 2009-03-16 02:16
     Query page      Enter new bug
Bug#: 9733   Hardware:   Reporter: Michael Kerrisk <mtk.manpages@gmail.com>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: FIXED   Severity:  
Assigned To: Ulrich Drepper <drepper@redhat.com>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
audit.c test program text/plain 2009-01-12 04:58 Edit None
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 9733 depends on: Show dependency tree
Show dependency graph
Bug 9733 blocks:

Additional Comments:


Leave as RESOLVED FIXED
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2009-01-12 04:52
Although the glibc source code suggests that it is possible to (and the Solaris
implementation permits) have multiple dynamic linker auditing libraries, this
feature does not appear to work correctly as currently implemented.  My attempts
to do this yield a SIGSEGV.

------- Additional Comment #1 From Michael Kerrisk 2009-01-12 04:58 -------
Created an attachment (id=3657)
test program

Below, two uses of an auditing library created from the attached source file. 
In the first run, the .so is assigned just once to LD_AUDIT.  In the second
run, the .so is assigned twice to LD_AUDIT, as a colon-separated list (leading
to a SIGSEGV).

$ cc -g -shared -fPIC -o audit.so audit.c
$ LD_AUDIT=./audit.so  /bin/true
la_version(): 1
la_objopen(): loading ""; lmid = LM_ID_BASE; cookie=b7f5f8d0
la_objopen(): loading "/lib/ld-linux.so.2"; lmid = LM_ID_BASE; cookie=b7f5f4f0
la_activity(): cookie = b7f5f8d0; flag = LA_ACT_ADD
la_objsearch(): name = libc.so.6; cookie = b7f5f8d0; flag = LA_SER_ORIG
la_objsearch(): name = /lib/libc.so.6; cookie = b7f5f8d0; flag = LA_SER_CONFIG
la_objopen(): loading "/lib/libc.so.6"; lmid = LM_ID_BASE; cookie=b7f41ad8
la_activity(): cookie = b7f5f8d0; flag = LA_ACT_CONSISTENT
la_symbind32(): symname = __libc_start_main; sym->st_value = 0xb7c96510
	ndx = 2149; flags = 0x0; refcook = b7f5f8d0; defcook = b7f41ad8
[...]

$ LD_AUDIT=./audit.so:./audit.so  /bin/true
la_version(): 1
la_objsearch(): name = ./audit.so; cookie = 250; flag = LA_SER_ORIG
Segmentation fault (core dumped)

------- Additional Comment #2 From Michael Kerrisk 2009-01-12 05:02 -------
By contrast, using a version of my audit.c library twice in a colon-separated
library on Solaris 8 does what I would expect (i.e., the audit functions are
called twice, once for each item listed in LD_AUDIT):

$ gcc -g -shared -fPIC -o audit.so audit.c
$ LD_AUDIT=./audit.so:./audit.so /bin/date
la_version(): 2
la_objopen(): loading "/bin/date"; cookie=ff3712f0
la_objopen(): loading "/bin/date"; cookie=ff3712fc
la_objopen()
la_objopen()
la_activity(): LA_ACT_ADD; cookie = ff3712f0
la_activity(): LA_ACT_ADD; cookie = ff3712f0
la_objsearch(): libc.so.1; ff3712f0; 1
la_objsearch(): libc.so.1; ff3712f0; 1
la_objsearch(): /usr/lib/libc.so.1; ff3712f0; 40
la_objsearch(): /usr/lib/libc.so.1; ff3712f0; 40
la_objopen(): loading "/usr/lib/libc.so.1"; cookie=ff3716d4
la_objopen(): loading "/usr/lib/libc.so.1"; cookie=ff3716e0
la_objsearch(): libdl.so.1; ff3716d4; 1
la_objsearch(): libdl.so.1; ff3716d4; 1
la_objsearch(): /usr/lib/libdl.so.1; ff3716d4; 40
la_objsearch(): /usr/lib/libdl.so.1; ff3716d4; 40
la_objopen(): loading "/usr/lib/libdl.so.1"; cookie=ff371a1c
la_objopen(): loading "/usr/lib/libdl.so.1"; cookie=ff371a28
[...]

------- Additional Comment #3 From Ulrich Drepper 2009-03-16 02:16 -------
Fixed in cvs.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In