diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 615e6bdb93ef..6e1a449d3cea 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -77,6 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.179 2022/03/12 17:45:53 riastradh #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_KMEM, + (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;