This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/20292] Comparison in elf/dl-open.c _dl_addr_inside_object is always true.
- From: "carlos at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 04 Jul 2016 17:15:30 +0000
- Subject: [Bug dynamic-link/20292] Comparison in elf/dl-open.c _dl_addr_inside_object is always true.
- Auto-submitted: auto-generated
- References: <bug-20292-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20292
--- Comment #2 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Florian Weimer from comment #1)
> __off_t does not seem to be the right type here because it can be larger
> than ElfW(Addr). I think we need to draw some pretty diagrams and figure
> out from scratch which comparisons this function has to perform.
The answer is that the statement can just be removed.
It is sufficient to use "reladdr - l->l_phdr[n].p_vaddr < l->l_phdr[n].p_memsz"
as the only statement to detect if the address is within the segment. The
address has already been relocated by l_addr, so the above check is always true
if the address is within the segment and always false if it is outside the
segment.
https://www.sourceware.org/ml/libc-alpha/2016-07/msg00110.html
--
You are receiving this mail because:
You are on the CC list for the bug.