This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/20292] Comparison in elf/dl-open.c _dl_addr_inside_object is always true.


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]