HomeFreeBSD

malloc: Fix DEBUG_REDZONE for contigmalloc()

Description

malloc: Fix DEBUG_REDZONE for contigmalloc()

When free() was adapted to support allocations originating from
contigmalloc(), redzone(9) support was not included. redzone(9)
involves adjusting the pointer to freed memory before looking up the
slab cookie, so it's not straightforward to make contigmalloc() opt out
of redzone support.

Thus, augment contigmalloc() to support redzone.

Reported by: glebius
Tested by: dhw
MFC after: 2 weeks
Fixes: 9e6544dd6e02 ("malloc(9): extend contigmalloc(9) by a "slab cookie"")

Details

Provenance
markjAuthored on Mar 23 2025, 1:42 PM
Parents
rG574816356834: socket: Fix a race in the SO_SPLICE state machine
Branches
Unknown
Tags
Unknown