HomeFreeBSD

uma: trash memory when ctor/dtor supplied too

Description

uma: trash memory when ctor/dtor supplied too

On INVARIANTS kernels, UMA has a use-after-free detection mechanism.
This mechanism previously required that all of the ctor/dtor/uminit/fini
arguments to uma_zcreate() be NULL in order to function. Now, it only
requires that uminit and fini be NULL; now, the trash ctor and dtor will
be called in addition to any supplied ctor or dtor.

Also do a little refactoring for readability of the resulting logic.

This enables use-after-free detection for more zones, and will allow for
simplification of some callers that worked around the previous
restriction (see kern_mbuf.c).

Reviewed by: jeff, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20722

Details

Provenance
rlibbyAuthored on
Reviewer
jeff
Differential Revision
D20722: uma: trash memory when ctor/dtor supplied too
Parents
rS355136: MFC r350579,r350741,r352584
Branches
Unknown
Tags
Unknown