]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
uma: Add KMSAN hooks
authorMark Johnston <markj@FreeBSD.org>
Tue, 10 Aug 2021 21:15:03 +0000 (17:15 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 11 Aug 2021 01:27:54 +0000 (21:27 -0400)
commit100949103a6340aff8a6a4caf1927374c242721c
treee6f09e2b873dfbb7ac1bce60d26aec01927899f7
parent693c9516fa6070199d1406df3265687c5e8b184a
uma: Add KMSAN hooks

For now, just hook the allocation path: upon allocation, items are
marked as initialized (absent M_ZERO).  Some zones are exempted from
this when it would otherwise raise false positives.

Use kmsan_orig() to update the origin map for UMA and malloc(9)
allocations.  This allows KMSAN to print the return address when an
uninitialized UMA item is implicated in a report.  For example:
  panic: MSan: Uninitialized UMA memory from m_getm2+0x7fe

Sponsored by: The FreeBSD Foundation
sys/kern/kern_malloc.c
sys/kern/kern_mbuf.c
sys/vm/uma_core.c
sys/vm/vm_glue.c