Bug 141491

Summary: DT_INITFIRST, DT_PREINIT_ARRAY are invisible to audit by r_debug.r_brk
Product: [Fedora] Fedora Reporter: John Reiser <jreiser>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: drepper
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-06 21:35:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Reiser 2004-12-01 16:24:09 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2)
Gecko/20040308

Description of problem:
During module loading, functions specified in PT_DYNAMIC by
DT_INITFIRST and DT_PREINIT_ARRAY are called before r_debug.r_brk is
notified that a new module has been loaded.  [Functions specified by
DT_INIT and DT_INITARRAY are called after .r_brk has been told about
RT_ADD.]  This makes it difficult to debug and/or audit the
DT_INITFIRST and DT_PREINIT_ARRAY functions.  There should be new
RT_ADDFIRST and RT_ADDPRE values [analogous to RT_ADD], and
corresponding calls to r_debug.r_brk, so that an audit can see all
activity that results from loading a new module.

Version-Release number of selected component (if applicable):
glibc-2.3.3-74

How reproducible:
Always

Steps to Reproduce:
1.  Inspect code for _dl_init() in elf/dl-init.c
2.
3.
    

Actual Results:  Functions tagged with DT_INITFIRST and
DT_PREINIT_ARRAY are called before r_debug.r_brk is notified that a
new module has been loaded.

Expected Results:  r_debug.r_brk is notified before any instruction in
the newly-loaded modules is executed.  There should be distinguishable
notifications for DT_INITFIRST and DT_PREINIT_ARRAY, in contrast to
DT_INITARRAY.

Additional info:

Comment 2 Jakub Jelinek 2005-07-06 21:35:04 UTC
Rawhide glibc notifies the debugger far earlier.