History log of /openbsd-src/lib/libc/stdlib/malloc.c (Results 176 – 200 of 297)
Revision Date Author Comments
# c050836b 07-Dec-2009 miod <miod@openbsd.org>

Make userland malloc use __LDPGSZ granularity on mips, regardless of the
actual kernel page size.


# 35adb2de 27-Nov-2009 otto <otto@openbsd.org>

Switch the chunk_info lists to doubly-linked lists and use the queue
macros for them. Avoids walking the lists and greatly enhances speed
of freeing chunks in reverse or random order at the cost of a

Switch the chunk_info lists to doubly-linked lists and use the queue
macros for them. Avoids walking the lists and greatly enhances speed
of freeing chunks in reverse or random order at the cost of a little
space. Suggested by Fabien Romano and Jonathan Armani; ok djm@

show more ...


# 9d95dd1c 27-Nov-2009 otto <otto@openbsd.org>

Don't forget to fill region from the cache with junk if needed in one case;
from Fabien Romano and Jonathan Armani


# 6c72f8dd 27-Nov-2009 otto <otto@openbsd.org>

No need to clear a mmapped region; from Fabien Romano and Jonathan
Armani


# 12bbd781 02-Nov-2009 todd <todd@openbsd.org>

permit -DMALLOC_STATS to compile again
noticed by Jonathan Armani & Fabien Romano
ugh+ok otto@


# c1559ed6 20-Oct-2009 pirofti <pirofti@openbsd.org>

Check mmap return value against MAP_FAILED not NULL.

Okay deraadt@, otto@.


# 41d8fd87 08-Jun-2009 deraadt <deraadt@openbsd.org>

quieten compiler by converting pointers to uintptr_t before truncating them
to u_int32_t to do integer math with (in a situation where that is legit)
ok otto millert


# 1ef73188 03-Jan-2009 djm <djm@openbsd.org>

reintroduce extra malloc protections, but avoiding the use of
PAGE_(SIZE|SHIFT|MASK) defines that evaluate to variables on the
sparc architecture;
ok otto@ tested on my reanimated ss20


# 8e3c6348 31-Dec-2008 deraadt <deraadt@openbsd.org>

PAGE_SIZE is not a valid symbol to use in that way. In particular,
on sparc, it expands to something that just plain does not work,
because the page size can be variable. Sorry we didn't spot this

PAGE_SIZE is not a valid symbol to use in that way. In particular,
on sparc, it expands to something that just plain does not work,
because the page size can be variable. Sorry we didn't spot this
before. Backing it all out to allow sparc to build; please find a
different way to fix it.

show more ...


# 88d4676d 30-Dec-2008 djm <djm@openbsd.org>

Remove mprotecting of struct dir_info introduced in previous commit
(MALLOC_OPTIONS=L). It was too slow to turn on by default, and we
don't do optional security.

requested by deraadt@ grumbling ok o

Remove mprotecting of struct dir_info introduced in previous commit
(MALLOC_OPTIONS=L). It was too slow to turn on by default, and we
don't do optional security.

requested by deraadt@ grumbling ok otto@

show more ...


# c97a2171 29-Dec-2008 djm <djm@openbsd.org>

extra paranoia for malloc(3):

Move all runtime options into a structure that is made read-only
(via mprotect) after initialisation to protect against attacks that
overwrite options to turn off mallo

extra paranoia for malloc(3):

Move all runtime options into a structure that is made read-only
(via mprotect) after initialisation to protect against attacks that
overwrite options to turn off malloc protections (e.g. use-after-free)

Allocate the main bookkeeping data (struct dir_info) using mmap(),
thereby giving it an unpredictable address. Place a PROT_NONE guard
page on either side to further frustrate attacks on it.

Add a new 'L' option that maps struct dir_info PROT_NONE except when
in the allocator code itself. Makes attacks on it basically impossible.

feedback tedu deraadt otto canacar
ok otto

show more ...


# 4b5eb2e9 15-Dec-2008 otto <otto@openbsd.org>

shave off more bytes than you expect by declaring a few const local arrays
as static const


# e594c53f 20-Nov-2008 otto <otto@openbsd.org>

move allocations between half a page and a page as close to the end of
the page as possible (i.e. make malloc option P a default).
ok art@ millert@ krw@


# 8d4d9a3c 20-Nov-2008 otto <otto@openbsd.org>

Reduce the leeway malloc allows when moving allocations to the end of
a page to 0. P default will be changed in a separate commit.
ok millert@ art@ krw@


# d8a6df9d 13-Nov-2008 otto <otto@openbsd.org>

To allow for easier playing with more strict settings introduce
a separate symbolic constant for the leeway we allow when moving
allocations towards the end of a page. No functional change.


# e40b6717 12-Nov-2008 otto <otto@openbsd.org>

avoid a few strlen calls for constant strings; prompted by tg; ok djm@


# b05e0fcd 06-Nov-2008 otto <otto@openbsd.org>

if the freeprot flag (F) is set, do not do delayed frees for chunks
(might catch errors closer to the trouble spot) and junk fill pages just
before reuse instead of immediate (we can't access the pag

if the freeprot flag (F) is set, do not do delayed frees for chunks
(might catch errors closer to the trouble spot) and junk fill pages just
before reuse instead of immediate (we can't access the page anyway)
since we set PROT_NONE in the F case. ok djm@

show more ...


# 3d00aa7a 02-Nov-2008 otto <otto@openbsd.org>

remove distinction between warnings and errors, ok deraadt@ djm@


# 716b20df 29-Oct-2008 otto <otto@openbsd.org>

if MALLOC_STATS is defined, record how many "cheap reallocs" were
tried and how many actually succeeded.


# a244a74f 20-Oct-2008 otto <otto@openbsd.org>

oops, assign errno the right way. caught by david running regress tests


# e6f339a7 03-Oct-2008 otto <otto@openbsd.org>

reduce rbyte cache to 512 bytes, no measurable slowdown (even in the
threaded case) but much smaller working set; prompted by and ok deraadt@


# 4a9374b5 03-Oct-2008 otto <otto@openbsd.org>

save and restore errno on success. while it is not stricly needed for
non-syscalls, there's just too much code not doing the right thing on
error paths; prompted by and ok deraadt@


# 7d6567a3 03-Oct-2008 otto <otto@openbsd.org>

when increasing the size of a larger than a page allocation try
mapping the region next to the existing one first; there's a pretty
high chance there's a hole there we can use; ok deraadt@ tedu@


# 842954f0 03-Oct-2008 otto <otto@openbsd.org>

avoid spitting up regions when purging stuff from the cache, it puts
too much pressure on the amaps. ok tedu@ deraadt@


# 1c1c1677 25-Aug-2008 otto <otto@openbsd.org>

Make all combinations of G, P, J and zero-fill work with as little
effort as possible in most cases; ok djm@


12345678910>>...12