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 libc/18292] Invalid pointer dereference in nsswitch.c:nss_new_service()


https://sourceware.org/bugzilla/show_bug.cgi?id=18292

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-

--- Comment #10 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Justin N. Ferguson from comment #1)
> repro:
> set prev_size member of chunk to non-zero value that doesn't properly
> dereference. execute "ls -al".

I assume that this is about the prev_size member of the following chunk.  Have
you increased the chunk size accordingly (by the size of a pointer)?  If not,
your malloc invalid because prev_size is only available if the preceding chunk
is free, as explained in comment #2.

The fundamental idea behind the free space management in dlmalloc and similar
allocators is to use the trailing end of a free chunk to store a pointer (or
offset) to its beginning, so that when the subsequent chunk is freed, it can be
merged with the preceding one.  Without the information prev_size provides, it
would not be possible to find the start of the chunk to merge with.  This is
explained on page 28 of <ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps> and
sometimes called a âboundary tagâ mechanism.

valgrind also does not show any out-of-bounds references, and it is usually
very precise for such issues.

-- 
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]