]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
uma: Add KASAN state transitions
authorMark Johnston <markj@FreeBSD.org>
Tue, 13 Apr 2021 21:39:50 +0000 (17:39 -0400)
committerMark Johnston <markj@FreeBSD.org>
Tue, 13 Apr 2021 21:42:21 +0000 (17:42 -0400)
commit09c8cb717d214d03e51b3e4f8e9997b9f4e1624d
tree241afc2fd2e03e676e8aeb48b37eebf5fc9677c2
parentf115c0612131d8f939f6f357f57bdd85bd6a59de
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:
  1) when a slab is imported into a keg
  2) when an item is allocated from a zone
  3) when an item is freed to a zone
  4) 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
sys/vm/uma.h
sys/vm/uma_core.c