CVSROOT:        /cvs
Module name:    src
Changes by:     o...@cvs.openbsd.org    2023/06/04 00:58:33

Modified files:
        lib/libc/stdlib: malloc.3 malloc.c 
        regress/lib/libc/malloc/malloc_errs: malloc_errs.c 

Log message:
More thorough write-afetr-free checks.

On free, chunks (the pieces of a pages used for smaller allocations)
are junked and then validated after they leave the delayed free
list.  So after free, a chunk always contains junk bytes. This means
that if we start with the right contents for a new page of chunks,
we can *validate* instead of *write* junk bytes when (re)-using a
chunk.

With this, we can detect write-after-free when a chunk is recycled,
not justy when a chunk is in the delayed free list.  We do a little
bit more work on initial allocation of a page of chunks and when
re-using (as we validate now even on junk level 1).

Also: some extra consistency checks for recallocaray(3) and fixes
in error messages to make them more consistent, with man page bits.

Plus regress additions.

Reply via email to