kern: Ensure that thread-local KMSAN state is available
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
a422084abb
commit
5dda15adbc
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user