uma: Add KASAN state transitions
- Add a UMA_ZONE_NOKASAN flag to indicate that items from a particular zone should not be sanitized. This is applied implicitly for NOFREE and cache zones.
- Add KASAN call backs which get invoked:
- when a slab is imported into a keg
- when an item is allocated from a zone
- when an item is freed to a zone
- when a slab is freed back to the VM
In state transitions 1 and 3, memory is poisoned so that accesses will trigger a panic. In state transitions 2 and 4, memory is marked valid.
- Disable trashing if KASAN is enabled. It just adds extra CPU overhead to catch problems that are detected by KASAN.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29456