freebsd-src/sys/vm
Mark Johnston 800da341bc thread: Simplify sanitizer integration with thread creation
fork() may allocate a new thread in one of two ways: from UMA, or cached
in a freed proc that was just allocated from UMA.  In either case, KASAN
and KMSAN need to initialize some state; in particular they need to
initialize the shadow mapping of the new thread's stack.

This is done differently between KASAN and KMSAN, which is confusing.
This patch improves things a bit:
- Add a new thread_recycle() function, which moves all kernel stack
  handling out of kern_fork.c, since it doesn't really belong there.
- Then, thread_alloc_stack() has only one local caller, so just inline
  it.
- Avoid redundant shadow stack initialization: thread_alloc()
  initializes the KMSAN shadow stack (via kmsan_thread_alloc()) even
  through vm_thread_new() already did that.
- Add kasan_thread_alloc(), for consistency with kmsan_thread_alloc().

No functional change intended.

Reviewed by:	khng
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44891
2024-04-22 11:46:59 -04:00
..
_vm_phys.h
_vm_radix.h
device_pager.c
memguard.c
memguard.h
phys_pager.c
pmap.h pmap: Convert boolean_t to bool. 2024-01-31 14:48:26 -08:00
redzone.c
redzone.h
sg_pager.c
swap_pager.c swap_pager: Unbusy readahead pages after an I/O error 2024-04-08 09:02:48 -04:00
swap_pager.h
uma.h
uma_align_mask.h
uma_core.c
uma_dbg.c
uma_dbg.h
uma_int.h
vm.h vm: add macro to mark arguments used when NUMA is defined 2024-04-09 10:23:47 -04:00
vm_domainset.c
vm_domainset.h
vm_dumpset.h
vm_extern.h vm: improve kstack_object pindex calculation to avoid pindex holes 2024-04-10 17:37:20 +02:00
vm_fault.c
vm_glue.c thread: Simplify sanitizer integration with thread creation 2024-04-22 11:46:59 -04:00
vm_init.c
vm_kern.c
vm_kern.h vm: improve kstack_object pindex calculation to avoid pindex holes 2024-04-10 17:37:20 +02:00
vm_map.c
vm_map.h
vm_meter.c
vm_mmap.c
vm_object.c sysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed 2024-01-16 22:15:39 +02:00
vm_object.h
vm_page.c
vm_page.h vm: add macro to mark arguments used when NUMA is defined 2024-04-09 10:23:47 -04:00
vm_pageout.c
vm_pageout.h
vm_pagequeue.h
vm_pager.c
vm_pager.h
vm_param.h
vm_phys.c vm: add macro to mark arguments used when NUMA is defined 2024-04-09 10:23:47 -04:00
vm_phys.h vm: add macro to mark arguments used when NUMA is defined 2024-04-09 10:23:47 -04:00
vm_radix.c
vm_radix.h
vm_reserv.c vm_reserv_reclaim_contig: Return NULL not false 2024-04-10 08:50:16 -04:00
vm_reserv.h vm_reserv: Add vm_reserv_is_populated 2024-04-07 12:28:52 -05:00
vm_swapout.c vm: improve kstack_object pindex calculation to avoid pindex holes 2024-04-10 17:37:20 +02:00
vm_swapout_dummy.c
vm_unix.c
vnode_pager.c Add vnode_pager_clean_{a,}sync(9) 2024-01-11 18:44:53 +02:00
vnode_pager.h Add vnode_pager_clean_{a,}sync(9) 2024-01-11 18:44:53 +02:00