public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results
@ 2007-03-05 20:28 suzuki at in dot ibm dot com
  2007-03-05 20:29 ` [Bug libc/4131] " suzuki at in dot ibm dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: suzuki at in dot ibm dot com @ 2007-03-05 20:28 UTC (permalink / raw)
  To: glibc-bugs

We encountered a problem with dl-addr which would return incorrect results for
an address lookup.

The problem occurs when a library (say libA) is mapped (by glibc) in the space
between two loaded segments of an already mapped library ( we have seen this
library is most of the time ld-linux.so). In this case we have,

LD.SO.l_map_start < LIBA.l_map_start < LIBA.l_map_end < LD.SO.l_map_end


So while looking up an address in LIBA, we get the result as LD.SO which
confuses the caller.

This is due to the following bug in the dl-addr logic:

1) We find a link_map whose [l_map_start,l_map_end) encloses the address.

2) We consult only the *LAST* loaded segment of the lib to check if the address
lies beyond the segment's end address.

So, if the ld.so is consulted before libA, we end up in returning ld.so as the
result.

The proper fix here would be to make sure that the address *falls in* _any_ of
the segments of the library.

-- 
           Summary: BUG : dladdr() doesn't return the correct results
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: critical
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: suzuki at in dot ibm dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: All
  GCC host triplet: All
GCC target triplet: All


http://sourceware.org/bugzilla/show_bug.cgi?id=4131

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/4131] BUG : dladdr() doesn't return the correct results
  2007-03-05 20:28 [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results suzuki at in dot ibm dot com
@ 2007-03-05 20:29 ` suzuki at in dot ibm dot com
  2007-05-06 21:02 ` drepper at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: suzuki at in dot ibm dot com @ 2007-03-05 20:29 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From suzuki at in dot ibm dot com  2007-03-05 20:29 -------
Created an attachment (id=1598)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1598&action=view)
Patch to fix dl-addr

The patch fixes the bug in dl-addr.  

The patch makes sure that the address being looked up lies in one of the loaded
segments of the library.

Thanks

Suzuki

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper at redhat dot com   |suzuki at in dot ibm dot com
             Status|NEW                         |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=4131

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/4131] BUG : dladdr() doesn't return the correct results
  2007-03-05 20:28 [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results suzuki at in dot ibm dot com
  2007-03-05 20:29 ` [Bug libc/4131] " suzuki at in dot ibm dot com
@ 2007-05-06 21:02 ` drepper at redhat dot com
  2007-07-12 15:15 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: drepper at redhat dot com @ 2007-05-06 21:02 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-05-06 22:02 -------
I rewrote the patch to be more efficient and clearer.  Also, you are not
following the coding standard, don't update the copyright year, etc.

Plus: do not ever change priority of severity.  You cannot judge this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|ASSIGNED                    |RESOLVED
           Priority|P2                          |P1
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=4131

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/4131] BUG : dladdr() doesn't return the correct results
  2007-03-05 20:28 [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results suzuki at in dot ibm dot com
  2007-03-05 20:29 ` [Bug libc/4131] " suzuki at in dot ibm dot com
  2007-05-06 21:02 ` drepper at redhat dot com
@ 2007-07-12 15:15 ` cvs-commit at gcc dot gnu dot org
  2007-10-09  5:06 ` bugs at elyoung dot com
  2007-10-15  1:36 ` drepper at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2007-07-12 15:15 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2007-07-12 15:15 -------
Subject: Bug 4131

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_5-branch
Changes by:	jakub@sourceware.org	2007-07-12 15:15:16

Modified files:
	.              : ChangeLog 
	elf            : dl-addr.c 

Log message:
	2007-05-06  Ulrich Drepper  <drepper@redhat.com>
	
	[BZ #4131]
	* elf/dl-addr.c (_dl_addr): Compare address with actual segment
	boundaries to work around systems with overlapping binary loading.
	Based on a patch by Suzuki <suzuki@in.ibm.com>.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.10362.2.80&r2=1.10362.2.81
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/elf/dl-addr.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.31&r2=1.31.2.1



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4131

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/4131] BUG : dladdr() doesn't return the correct results
  2007-03-05 20:28 [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results suzuki at in dot ibm dot com
                   ` (2 preceding siblings ...)
  2007-07-12 15:15 ` cvs-commit at gcc dot gnu dot org
@ 2007-10-09  5:06 ` bugs at elyoung dot com
  2007-10-15  1:36 ` drepper at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: bugs at elyoung dot com @ 2007-10-09  5:06 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bugs at elyoung dot com  2007-10-09 05:05 -------
Hi,
I'm not sure the procedure here, so excuse me if reopening was incorrect.

This bug still seems to affect the 2.6 branch. (and the trunk as well?)
Can we get the same patch into the 2.6 branch to fix this there, or do we need a
separate bug to track it?

Thanks,
--Mike

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugs at elyoung dot com
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://sourceware.org/bugzilla/show_bug.cgi?id=4131

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/4131] BUG : dladdr() doesn't return the correct results
  2007-03-05 20:28 [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results suzuki at in dot ibm dot com
                   ` (3 preceding siblings ...)
  2007-10-09  5:06 ` bugs at elyoung dot com
@ 2007-10-15  1:36 ` drepper at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: drepper at redhat dot com @ 2007-10-15  1:36 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-10-15 01:36 -------
Don't open bugs for branches.  They might or might get a fix.  In general nobody
should expect any branch to be updated.  Just use the latest code.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=4131

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-10-15  1:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-05 20:28 [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results suzuki at in dot ibm dot com
2007-03-05 20:29 ` [Bug libc/4131] " suzuki at in dot ibm dot com
2007-05-06 21:02 ` drepper at redhat dot com
2007-07-12 15:15 ` cvs-commit at gcc dot gnu dot org
2007-10-09  5:06 ` bugs at elyoung dot com
2007-10-15  1:36 ` drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).