diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 615e6bdb93ef..7430e5a39649 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -71,6 +71,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.179 2022/03/12 17:45:53 riastradh #include #include #include +#include #include #include #include @@ -503,8 +504,12 @@ ktealloc(struct ktrace_entry **ktep, void **bufp, lwp_t *l, int type, return EAGAIN; kte = pool_cache_get(kte_cache, PR_WAITOK); + kmsan_orig(kte, sizeof(*kte), KMSAN_TYPE_POOL, + (uintptr_t)__builtin_return_address(0)); if (sz > sizeof(kte->kte_space)) { buf = kmem_alloc(sz, KM_SLEEP); + kmsan_orig(buf, sz, KMSAN_TYPE_KMEM, + (uintptr_t)__builtin_return_address(0)); } else buf = kte->kte_space;