public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12140] New: mallopt(M_PERTURB) free() anomaly
@ 2010-10-20  2:40 mtk.manpages at gmail dot com
  2010-10-20  2:42 ` [Bug libc/12140] " mtk.manpages at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mtk.manpages at gmail dot com @ 2010-10-20  2:40 UTC (permalink / raw)
  To: glibc-bugs

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

           Summary: mallopt(M_PERTURB) free() anomaly
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: mtk.manpages@gmail.com


If mallopt() is used to set M_PERTURB, then, as expected, the bytes of
allocated memory are allocated to the complement of the byte in the 'value'
argument.

When that memory is freed, then the bytes of the region are initialized to the
byte specified in 'value'. However, there is an off-by-sizeof(size_t) error in
the code: instead of initializing precisely the block of memory being freed,
the block starting at p+sizeof(size_t) is initialized.

It looks like the two lines of this form in malloc/malloc.c

      free_perturb (chunk2mem(p), size - SIZE_SZ);

should instead be

      free_perturb (p, size);

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2014-06-30  7:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-20  2:40 [Bug libc/12140] New: mallopt(M_PERTURB) free() anomaly mtk.manpages at gmail dot com
2010-10-20  2:42 ` [Bug libc/12140] " mtk.manpages at gmail dot com
2010-10-25  2:37 ` drepper.fsp at gmail dot com
2012-03-18 21:07 ` mtk.manpages at gmail dot com
2012-03-19 15:52 ` [Bug malloc/12140] " jsm28 at gcc dot gnu.org
2012-10-17 12:35 ` siddhesh at redhat dot com
2012-10-17 12:55 ` mtk.manpages at gmail dot com
2012-10-17 13:02 ` siddhesh at redhat dot com
2012-10-17 14:11 ` mtk.manpages at gmail dot com
2012-10-17 14:33 ` siddhesh at redhat dot com
2012-10-18  3:00 ` siddhesh at redhat dot com
2014-06-30  7:25 ` fweimer 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).