Date: Wed, 11 Aug 2021 01:31:04 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 5dda15adbcf7 - main - kern: Ensure that thread-local KMSAN state is available Message-ID: <202108110131.17B1V42f051011@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5dda15adbcf7b650fb69b5259090b16c66d1cf1a commit 5dda15adbcf7b650fb69b5259090b16c66d1cf1a Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-08-11 00:58:00 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-08-11 01:27:53 +0000 kern: Ensure that thread-local KMSAN state is available Sponsored by: The FreeBSD Foundation --- sys/kern/kern_fork.c | 2 ++ sys/kern/kern_thread.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 7a80f7de85d8..b71a00adb62e 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/lock.h> #include <sys/malloc.h> +#include <sys/msan.h> #include <sys/mutex.h> #include <sys/priv.h> #include <sys/proc.h> @@ -958,6 +959,7 @@ fork1(struct thread *td, struct fork_req *fr) } proc_linkup(newproc, td2); } else { + kmsan_thread_alloc(td2); if (td2->td_kstack == 0 || td2->td_kstack_pages != pages) { if (td2->td_kstack != 0) vm_thread_dispose(td2); diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 28a517e9b35e..cb35d565974d 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/kernel.h> #include <sys/lock.h> +#include <sys/msan.h> #include <sys/mutex.h> #include <sys/proc.h> #include <sys/bitstring.h> @@ -761,6 +762,7 @@ thread_alloc(int pages) return (NULL); } td->td_tid = tid; + kmsan_thread_alloc(td); cpu_thread_alloc(td); EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); return (td); @@ -797,6 +799,7 @@ thread_free_batched(struct thread *td) * Freeing handled by the caller. */ td->td_tid = -1; + kmsan_thread_free(td); uma_zfree(thread_zone, td); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108110131.17B1V42f051011>