<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc.git/malloc/Makefile, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/'/>
<entry>
<title>malloc: add free_sized and free_aligned_sized from C23</title>
<updated>2025-11-19T16:47:53+00:00</updated>
<author>
<name>Justin King</name>
<email>jcking@google.com</email>
</author>
<published>2025-10-22T12:51:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=56549264d1e1723dc8ad9675141f316dc83626b3'/>
<id>56549264d1e1723dc8ad9675141f316dc83626b3</id>
<content type='text'>
Signed-off-by: Justin King &lt;jcking@google.com&gt;
Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Justin King &lt;jcking@google.com&gt;
Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: add tst-mxfast to hugetlb exclusion list</title>
<updated>2025-08-29T17:22:19+00:00</updated>
<author>
<name>DJ Delorie</name>
<email>dj@redhat.com</email>
</author>
<published>2025-08-28T21:02:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=320cf1e1b59d656ce59478cd052f0e206f8f8bb3'/>
<id>320cf1e1b59d656ce59478cd052f0e206f8f8bb3</id>
<content type='text'>
tst-mxfast needs GLIBC_TUNABLES to be set to its own value.

Reviewed-by: Wilco Dijkstra  &lt;Wilco.Dijkstra@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tst-mxfast needs GLIBC_TUNABLES to be set to its own value.

Reviewed-by: Wilco Dijkstra  &lt;Wilco.Dijkstra@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: Support hugepages in mremap_chunk</title>
<updated>2025-08-27T13:07:09+00:00</updated>
<author>
<name>Wilco Dijkstra</name>
<email>wilco.dijkstra@arm.com</email>
</author>
<published>2025-08-27T13:04:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=921e251e8f364d00fc753274095007275381ae65'/>
<id>921e251e8f364d00fc753274095007275381ae65</id>
<content type='text'>
Add mremap_chunk support for mmap()ed chunks using hugepages by accounting for
their alignment, to prevent the mremap call failing in most cases where the
size passed is not a hugepage size multiple. It also improves robustness for
reallocating hugepages since mremap is much less likely to fail, so running
out of memory when reallocating a larger size and having to copy the old
contents after mremap fails is also less likely.

To track whether an mmap()ed chunk uses hugepages, have a flag in the lowest
bit of the mchunk_prev_size field which is set after a call to sysmalloc_mmap,
and accessed later in mremap_chunk. Create macros for getting and setting this
bit, and for mapping the bit off when accessing the field for mmap()ed chunks.
Since the alignment cannot be lower than 8 bytes, this flag cannot affect the
alignment data.

Add malloc/tst-tcfree4-malloc-check to the tests-exclude-malloc-check list as
malloc-check prevents the tcache from being used to store chunks. This test
caused failures due to a bug in mem2chunk_check to be fixed in a later patch.

Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add mremap_chunk support for mmap()ed chunks using hugepages by accounting for
their alignment, to prevent the mremap call failing in most cases where the
size passed is not a hugepage size multiple. It also improves robustness for
reallocating hugepages since mremap is much less likely to fail, so running
out of memory when reallocating a larger size and having to copy the old
contents after mremap fails is also less likely.

To track whether an mmap()ed chunk uses hugepages, have a flag in the lowest
bit of the mchunk_prev_size field which is set after a call to sysmalloc_mmap,
and accessed later in mremap_chunk. Create macros for getting and setting this
bit, and for mapping the bit off when accessing the field for mmap()ed chunks.
Since the alignment cannot be lower than 8 bytes, this flag cannot affect the
alignment data.

Add malloc/tst-tcfree4-malloc-check to the tests-exclude-malloc-check list as
malloc-check prevents the tcache from being used to store chunks. This test
caused failures due to a bug in mem2chunk_check to be fixed in a later patch.

Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: Link large tcache tests with $(shared-thread-library)</title>
<updated>2025-06-19T10:42:12+00:00</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2025-06-19T04:30:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=124bf1fb6b85e201275764c8f5d046861eb6ed65'/>
<id>124bf1fb6b85e201275764c8f5d046861eb6ed65</id>
<content type='text'>
Introduce tests-link-with-libpthread to list tests that
require linking with libpthread, and use that to generate
dependencies on $(shared-thread-library) for all multi-threaded tests.

Fixes build failures of commit cde5caa4bb21d5c474b9e4762cc847bcbc70e481
("malloc: add testing for large tcache support") on Hurd.

Reviewed-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce tests-link-with-libpthread to list tests that
require linking with libpthread, and use that to generate
dependencies on $(shared-thread-library) for all multi-threaded tests.

Fixes build failures of commit cde5caa4bb21d5c474b9e4762cc847bcbc70e481
("malloc: add testing for large tcache support") on Hurd.

Reviewed-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: Sort tests-exclude-largetcache in Makefile</title>
<updated>2025-06-16T22:06:06+00:00</updated>
<author>
<name>H.J. Lu</name>
<email>hjl.tools@gmail.com</email>
</author>
<published>2025-06-16T21:52:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=d1b27eeda3d92f33314e93537437cab11ddf4777'/>
<id>d1b27eeda3d92f33314e93537437cab11ddf4777</id>
<content type='text'>
This fixes:

FAIL: lint-makefiles

Signed-off-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes:

FAIL: lint-makefiles

Signed-off-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: add testing for large tcache support</title>
<updated>2025-06-16T12:54:32+00:00</updated>
<author>
<name>Cupertino Miranda</name>
<email>cupertino.miranda@oracle.com</email>
</author>
<published>2025-06-16T12:51:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=cde5caa4bb21d5c474b9e4762cc847bcbc70e481'/>
<id>cde5caa4bb21d5c474b9e4762cc847bcbc70e481</id>
<content type='text'>
This patch adds large tcache support tests by re-executing malloc tests
using the tunable:  glibc.malloc.tcache_max=1048576
Test names are postfixed with "largetcache".

Reviewed-by: Wilco Dijkstra  &lt;Wilco.Dijkstra@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds large tcache support tests by re-executing malloc tests
using the tunable:  glibc.malloc.tcache_max=1048576
Test names are postfixed with "largetcache".

Reviewed-by: Wilco Dijkstra  &lt;Wilco.Dijkstra@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: Improved double free detection in the tcache</title>
<updated>2025-05-12T11:58:30+00:00</updated>
<author>
<name>David Lau</name>
<email>david.lau@fau.de</email>
</author>
<published>2025-05-12T11:42:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=eff1f680cffb005a5623d1c8a952d095b988d6a2'/>
<id>eff1f680cffb005a5623d1c8a952d095b988d6a2</id>
<content type='text'>
The previous double free detection did not account for an attacker to
use a terminating null byte overflowing from the previous
chunk to change the size of a memory chunk is being sorted into.
So that the check in 'tcache_double_free_verify' would pass
even though it is a double free.

Solution:
Let 'tcache_double_free_verify' iterate over all tcache entries to
detect double frees.

This patch only protects from buffer overflows by one byte.
But I would argue that off by one errors are the most common
errors to be made.

Alternatives Considered:
  Store the size of a memory chunk in big endian and thus
  the chunk size would not get overwritten because entries in the
  tcache are not that big.

  Move the tcache_key before the actual memory chunk so that it
  does not have to be checked at all, this would work better in general
  but also it would increase the memory usage.

Signed-off-by: David Lau  &lt;david.lau@fau.de&gt;
Reviewed-by: Wilco Dijkstra  &lt;Wilco.Dijkstra@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous double free detection did not account for an attacker to
use a terminating null byte overflowing from the previous
chunk to change the size of a memory chunk is being sorted into.
So that the check in 'tcache_double_free_verify' would pass
even though it is a double free.

Solution:
Let 'tcache_double_free_verify' iterate over all tcache entries to
detect double frees.

This patch only protects from buffer overflows by one byte.
But I would argue that off by one errors are the most common
errors to be made.

Alternatives Considered:
  Store the size of a memory chunk in big endian and thus
  the chunk size would not get overwritten because entries in the
  tcache are not that big.

  Move the tcache_key before the actual memory chunk so that it
  does not have to be checked at all, this would work better in general
  but also it would increase the memory usage.

Signed-off-by: David Lau  &lt;david.lau@fau.de&gt;
Reviewed-by: Wilco Dijkstra  &lt;Wilco.Dijkstra@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2025-01-01T19:22:09+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-01-01T18:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=2642002380aafb71a1d3b569b6d7ebeab3284816'/>
<id>2642002380aafb71a1d3b569b6d7ebeab3284816</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: Link threading tests with $(shared-thread-library)</title>
<updated>2024-08-20T14:16:25+00:00</updated>
<author>
<name>Samuel Thibault</name>
<email>samuel.thibault@ens-lyon.org</email>
</author>
<published>2024-08-20T14:16:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=251843e16fcec4e2b328577be66dcb2f3fa1c1e7'/>
<id>251843e16fcec4e2b328577be66dcb2f3fa1c1e7</id>
<content type='text'>
Fixes build failures on Hurd.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes build failures on Hurd.
</pre>
</div>
</content>
</entry>
<entry>
<title>malloc: Link threading tests with $(shared-thread-library)</title>
<updated>2024-07-27T14:46:49+00:00</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2024-07-27T14:23:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=a57cbbd85379874177d40d675f5b905e669d0a47'/>
<id>a57cbbd85379874177d40d675f5b905e669d0a47</id>
<content type='text'>
Fixes build failures on Hurd.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes build failures on Hurd.
</pre>
</div>
</content>
</entry>
</feed>
