FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/linker.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/memdesc.h>
#include <sys/msan.h>
#include <sys/proc.h>
#include <sys/stack.h>
#include <sys/sysctl.h>
#include <sys/uio.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/msan.h>
#include <machine/stdarg.h>
#include <machine/atomic.h>
#include <sys/atomic_san.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/bus_san.h>
Go to the source code of this file.
Data Structures | |
struct | msan_meta_t |
struct | msan_tls_t |
struct | kmsan_td |
Typedefs | |
typedef struct kmsan_td | msan_td_t |
Functions | |
__FBSDID ("$FreeBSD$") | |
void | kmsan_init_arg (size_t) |
void | kmsan_init_ret (size_t) |
static uint8_t msan_dummy_shad[PAGE_SIZE] | __aligned (PAGE_SIZE) |
FEATURE (kmsan, "Kernel memory sanitizer") | |
static | SYSCTL_NODE (_debug, OID_AUTO, kmsan, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "KMSAN options") |
SYSCTL_BOOL (_debug_kmsan, OID_AUTO, panic_on_violation, CTLFLAG_RWTUN, &panic_on_violation, 0, "Panic if an invalid access is detected") | |
static | MALLOC_DEFINE (M_KMSAN, "kmsan", "Kernel memory sanitizer") |
static const char * | kmsan_orig_name (int type) |
static void | kmsan_report_hook (const void *addr, size_t size, size_t off, const char *hook) |
static void | kmsan_report_inline (msan_orig_t orig, unsigned long pc) |
static msan_meta_t | kmsan_meta_get (const void *addr, size_t size, const bool write) |
static void | kmsan_origin_fill (const void *addr, msan_orig_t o, size_t size) |
static void | kmsan_shadow_fill (uintptr_t addr, uint8_t c, size_t size) |
static void | kmsan_meta_copy (void *dst, const void *src, size_t size) |
static void | kmsan_shadow_check (uintptr_t addr, size_t size, const char *hook) |
static void | kmsan_check_arg (size_t size, const char *hook) |
void | kmsan_thread_alloc (struct thread *td) |
void | kmsan_thread_free (struct thread *td) |
void | kmsan_intr_enter (void) |
void | kmsan_intr_leave (void) |
void | kmsan_shadow_map (vm_offset_t addr, size_t size) |
void | kmsan_orig (const void *addr, size_t size, int type, uintptr_t pc) |
void | kmsan_mark (const void *addr, size_t size, uint8_t c) |
void | kmsan_mark_bio (const struct bio *bp, uint8_t c) |
static void | kmsan_mark_ccb (const union ccb *ccb, uint8_t c) |
void | kmsan_mark_mbuf (const struct mbuf *m, uint8_t c) |
void | kmsan_check (const void *p, size_t sz, const char *descr) |
void | kmsan_check_bio (const struct bio *bp, const char *descr) |
void | kmsan_check_ccb (const union ccb *ccb, const char *descr) |
void | kmsan_check_mbuf (const struct mbuf *m, const char *descr) |
void | kmsan_init (void) |
msan_meta_t | __msan_metadata_ptr_for_load_n (void *, size_t) |
msan_meta_t | __msan_metadata_ptr_for_store_n (void *, size_t) |
void | __msan_instrument_asm_store (const void *, size_t) |
msan_orig_t | __msan_chain_origin (msan_orig_t) |
void | __msan_poison (const void *, size_t) |
void | __msan_unpoison (const void *, size_t) |
void | __msan_poison_alloca (const void *, uint64_t, const char *) |
void | __msan_unpoison_alloca (const void *, uint64_t) |
void | __msan_warning (msan_orig_t) |
msan_tls_t * | __msan_get_context_state (void) |
void * | kmsan_memcpy (void *dst, const void *src, size_t len) |
int | kmsan_memcmp (const void *b1, const void *b2, size_t len) |
void * | kmsan_memset (void *dst, int c, size_t len) |
void * | kmsan_memmove (void *dst, const void *src, size_t len) |
__strong_reference (kmsan_memcpy, __msan_memcpy) | |
__strong_reference (kmsan_memset, __msan_memset) | |
__strong_reference (kmsan_memmove, __msan_memmove) | |
char * | kmsan_strcpy (char *dst, const char *src) |
int | kmsan_strcmp (const char *s1, const char *s2) |
size_t | kmsan_strlen (const char *str) |
int | kmsan_copyin (const void *, void *, size_t) |
int | kmsan_copyout (const void *, void *, size_t) |
int | kmsan_copyinstr (const void *, void *, size_t, size_t *) |
int | kmsan_fubyte (volatile const void *base) |
int | kmsan_fuword16 (volatile const void *base) |
int | kmsan_fueword (volatile const void *base, long *val) |
int | kmsan_fueword32 (volatile const void *base, int32_t *val) |
int | kmsan_fueword64 (volatile const void *base, int64_t *val) |
int | kmsan_subyte (volatile void *base, int byte) |
int | kmsan_suword (volatile void *base, long word) |
int | kmsan_suword16 (volatile void *base, int word) |
int | kmsan_suword32 (volatile void *base, int32_t word) |
int | kmsan_suword64 (volatile void *base, int64_t word) |
int | kmsan_casueword32 (volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp, uint32_t newval) |
int | kmsan_casueword (volatile u_long *base, u_long oldval, u_long *oldvalp, u_long newval) |
MSAN_ATOMIC_FUNC_ADD (8, uint8_t) | |
MSAN_ATOMIC_FUNC_ADD (16, uint16_t) | |
MSAN_ATOMIC_FUNC_ADD (32, uint32_t) | |
MSAN_ATOMIC_FUNC_ADD (64, uint64_t) | |
MSAN_ATOMIC_FUNC_ADD (int, u_int) | |
MSAN_ATOMIC_FUNC_ADD (long, u_long) | |
MSAN_ATOMIC_FUNC_ADD (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_SUBTRACT (8, uint8_t) | |
MSAN_ATOMIC_FUNC_SUBTRACT (16, uint16_t) | |
MSAN_ATOMIC_FUNC_SUBTRACT (32, uint32_t) | |
MSAN_ATOMIC_FUNC_SUBTRACT (64, uint64_t) | |
MSAN_ATOMIC_FUNC_SUBTRACT (int, u_int) | |
MSAN_ATOMIC_FUNC_SUBTRACT (long, u_long) | |
MSAN_ATOMIC_FUNC_SUBTRACT (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_SET (8, uint8_t) | |
MSAN_ATOMIC_FUNC_SET (16, uint16_t) | |
MSAN_ATOMIC_FUNC_SET (32, uint32_t) | |
MSAN_ATOMIC_FUNC_SET (64, uint64_t) | |
MSAN_ATOMIC_FUNC_SET (int, u_int) | |
MSAN_ATOMIC_FUNC_SET (long, u_long) | |
MSAN_ATOMIC_FUNC_SET (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_CLEAR (8, uint8_t) | |
MSAN_ATOMIC_FUNC_CLEAR (16, uint16_t) | |
MSAN_ATOMIC_FUNC_CLEAR (32, uint32_t) | |
MSAN_ATOMIC_FUNC_CLEAR (64, uint64_t) | |
MSAN_ATOMIC_FUNC_CLEAR (int, u_int) | |
MSAN_ATOMIC_FUNC_CLEAR (long, u_long) | |
MSAN_ATOMIC_FUNC_CLEAR (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_FETCHADD (32, uint32_t) | |
MSAN_ATOMIC_FUNC_FETCHADD (64, uint64_t) | |
MSAN_ATOMIC_FUNC_FETCHADD (int, u_int) | |
MSAN_ATOMIC_FUNC_FETCHADD (long, u_long) | |
MSAN_ATOMIC_FUNC_READANDCLEAR (32, uint32_t) | |
MSAN_ATOMIC_FUNC_READANDCLEAR (64, uint64_t) | |
MSAN_ATOMIC_FUNC_READANDCLEAR (int, u_int) | |
MSAN_ATOMIC_FUNC_READANDCLEAR (long, u_long) | |
MSAN_ATOMIC_FUNC_READANDCLEAR (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_TESTANDCLEAR (32, uint32_t) | |
MSAN_ATOMIC_FUNC_TESTANDCLEAR (64, uint64_t) | |
MSAN_ATOMIC_FUNC_TESTANDCLEAR (int, u_int) | |
MSAN_ATOMIC_FUNC_TESTANDCLEAR (long, u_long) | |
MSAN_ATOMIC_FUNC_TESTANDSET (32, uint32_t) | |
MSAN_ATOMIC_FUNC_TESTANDSET (64, uint64_t) | |
MSAN_ATOMIC_FUNC_TESTANDSET (int, u_int) | |
MSAN_ATOMIC_FUNC_TESTANDSET (long, u_long) | |
MSAN_ATOMIC_FUNC_SWAP (32, uint32_t) | |
MSAN_ATOMIC_FUNC_SWAP (64, uint64_t) | |
MSAN_ATOMIC_FUNC_SWAP (int, u_int) | |
MSAN_ATOMIC_FUNC_SWAP (long, u_long) | |
MSAN_ATOMIC_FUNC_SWAP (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_CMPSET (8, uint8_t) | |
MSAN_ATOMIC_FUNC_CMPSET (16, uint16_t) | |
MSAN_ATOMIC_FUNC_CMPSET (32, uint32_t) | |
MSAN_ATOMIC_FUNC_CMPSET (64, uint64_t) | |
MSAN_ATOMIC_FUNC_CMPSET (int, u_int) | |
MSAN_ATOMIC_FUNC_CMPSET (long, u_long) | |
MSAN_ATOMIC_FUNC_CMPSET (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_FCMPSET (8, uint8_t) | |
MSAN_ATOMIC_FUNC_FCMPSET (16, uint16_t) | |
MSAN_ATOMIC_FUNC_FCMPSET (32, uint32_t) | |
MSAN_ATOMIC_FUNC_FCMPSET (64, uint64_t) | |
MSAN_ATOMIC_FUNC_FCMPSET (int, u_int) | |
MSAN_ATOMIC_FUNC_FCMPSET (long, u_long) | |
MSAN_ATOMIC_FUNC_FCMPSET (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_LOAD (8, uint8_t) | |
MSAN_ATOMIC_FUNC_LOAD (16, uint16_t) | |
MSAN_ATOMIC_FUNC_LOAD (32, uint32_t) | |
MSAN_ATOMIC_FUNC_LOAD (64, uint64_t) | |
MSAN_ATOMIC_FUNC_LOAD (char, u_char) | |
MSAN_ATOMIC_FUNC_LOAD (short, u_short) | |
MSAN_ATOMIC_FUNC_LOAD (int, u_int) | |
MSAN_ATOMIC_FUNC_LOAD (long, u_long) | |
MSAN_ATOMIC_FUNC_LOAD (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_STORE (8, uint8_t) | |
MSAN_ATOMIC_FUNC_STORE (16, uint16_t) | |
MSAN_ATOMIC_FUNC_STORE (32, uint32_t) | |
MSAN_ATOMIC_FUNC_STORE (64, uint64_t) | |
MSAN_ATOMIC_FUNC_STORE (char, u_char) | |
MSAN_ATOMIC_FUNC_STORE (short, u_short) | |
MSAN_ATOMIC_FUNC_STORE (int, u_int) | |
MSAN_ATOMIC_FUNC_STORE (long, u_long) | |
MSAN_ATOMIC_FUNC_STORE (ptr, uintptr_t) | |
MSAN_ATOMIC_FUNC_THREAD_FENCE (acq) | |
MSAN_ATOMIC_FUNC_THREAD_FENCE (rel) | |
MSAN_ATOMIC_FUNC_THREAD_FENCE (acq_rel) | |
MSAN_ATOMIC_FUNC_THREAD_FENCE (seq_cst) | |
void | kmsan_atomic_interrupt_fence (void) |
int | kmsan_bus_space_map (bus_space_tag_t tag, bus_addr_t hnd, bus_size_t size, int flags, bus_space_handle_t *handlep) |
void | kmsan_bus_space_unmap (bus_space_tag_t tag, bus_space_handle_t hnd, bus_size_t size) |
int | kmsan_bus_space_subregion (bus_space_tag_t tag, bus_space_handle_t hnd, bus_size_t offset, bus_size_t size, bus_space_handle_t *handlep) |
void | kmsan_bus_space_free (bus_space_tag_t tag, bus_space_handle_t hnd, bus_size_t size) |
void | kmsan_bus_space_barrier (bus_space_tag_t tag, bus_space_handle_t hnd, bus_size_t offset, bus_size_t size, int flags) |
void | kmsan_bus_dmamap_sync (struct memdesc *desc, bus_dmasync_op_t op) |
Variables | |
static msan_tls_t | dummy_tls |
static msan_td_t | msan_thread0 |
static bool kmsan_enabled | __read_mostly |
static bool | kmsan_reporting = false |
static bool | panic_on_violation = 1 |
Definition at line 1119 of file subr_msan.c.
Definition at line 1164 of file subr_msan.c.
Definition at line 1234 of file subr_msan.c.
Definition at line 1251 of file subr_msan.c.
Definition at line 1274 of file subr_msan.c.
Definition at line 1149 of file subr_msan.c.
Definition at line 1289 of file subr_msan.c.
Definition at line 1134 of file subr_msan.c.
#define kmsan_panic | ( | f, | |
... | |||
) |
Definition at line 122 of file subr_msan.c.
Definition at line 1129 of file subr_msan.c.
Definition at line 1174 of file subr_msan.c.
Definition at line 1246 of file subr_msan.c.
Definition at line 1263 of file subr_msan.c.
Definition at line 1179 of file subr_msan.c.
Definition at line 1285 of file subr_msan.c.
Definition at line 1190 of file subr_msan.c.
Definition at line 1159 of file subr_msan.c.
Definition at line 1299 of file subr_msan.c.
Definition at line 1144 of file subr_msan.c.
Definition at line 1223 of file subr_msan.c.
Definition at line 1201 of file subr_msan.c.
Definition at line 1212 of file subr_msan.c.
#define MSAN_ATOMIC_FUNC_THREAD_FENCE | ( | name | ) |
Definition at line 1268 of file subr_msan.c.
#define MSAN_BUS_READ_FUNC | ( | func, | |
width, | |||
type | |||
) |
Definition at line 1451 of file subr_msan.c.
#define MSAN_BUS_READ_PTR_FUNC | ( | func, | |
width, | |||
type | |||
) |
#define MSAN_BUS_SET_FUNC | ( | func, | |
width, | |||
type | |||
) |
Definition at line 1539 of file subr_msan.c.
#define MSAN_BUS_WRITE_FUNC | ( | func, | |
width, | |||
type | |||
) |
Definition at line 1498 of file subr_msan.c.
#define MSAN_BUS_WRITE_PTR_FUNC | ( | func, | |
width, | |||
type | |||
) |
Definition at line 1505 of file subr_msan.c.
#define MSAN_META_FUNC | ( | size | ) |
Definition at line 692 of file subr_msan.c.
#define MSAN_NCONTEXT 4 |
Definition at line 97 of file subr_msan.c.
#define MSAN_ORIG_MASK (~0x3) |
Definition at line 98 of file subr_msan.c.
#define MSAN_PARAM_SIZE 800 |
Definition at line 83 of file subr_msan.c.
#define MSAN_RETVAL_SIZE 800 |
Definition at line 84 of file subr_msan.c.
#define REPORT | ( | f, | |
... | |||
) |
Definition at line 127 of file subr_msan.c.
#define SAN_RUNTIME |
Definition at line 35 of file subr_msan.c.
|
static |
__FBSDID | ( | "$FreeBSD$" | ) |
msan_orig_t __msan_chain_origin | ( | msan_orig_t | origin | ) |
Definition at line 725 of file subr_msan.c.
msan_tls_t * __msan_get_context_state | ( | void | ) |
Definition at line 767 of file subr_msan.c.
References kmsan_td::ctx, dummy_tls, and kmsan_td::tls.
void __msan_instrument_asm_store | ( | const void * | addr, |
size_t | size | ||
) |
Definition at line 719 of file subr_msan.c.
References addr, and kmsan_shadow_fill().
msan_meta_t __msan_metadata_ptr_for_load_n | ( | void * | addr, |
size_t | size | ||
) |
Definition at line 681 of file subr_msan.c.
References addr, and kmsan_meta_get().
msan_meta_t __msan_metadata_ptr_for_store_n | ( | void * | addr, |
size_t | size | ||
) |
Definition at line 687 of file subr_msan.c.
References addr, and kmsan_meta_get().
void __msan_poison | ( | const void * | addr, |
size_t | size | ||
) |
Definition at line 731 of file subr_msan.c.
References addr, and kmsan_shadow_fill().
void __msan_poison_alloca | ( | const void * | addr, |
uint64_t | size, | ||
const char * | descr | ||
) |
Definition at line 743 of file subr_msan.c.
References addr, kmsan_origin_fill(), and kmsan_shadow_fill().
void __msan_unpoison | ( | const void * | addr, |
size_t | size | ||
) |
Definition at line 737 of file subr_msan.c.
References addr, and kmsan_shadow_fill().
void __msan_unpoison_alloca | ( | const void * | addr, |
uint64_t | size | ||
) |
Definition at line 753 of file subr_msan.c.
References addr, and kmsan_shadow_fill().
void __msan_warning | ( | msan_orig_t | origin | ) |
Definition at line 759 of file subr_msan.c.
References kmsan_report_inline().
__strong_reference | ( | kmsan_memcpy | , |
__msan_memcpy | |||
) |
__strong_reference | ( | kmsan_memmove | , |
__msan_memmove | |||
) |
__strong_reference | ( | kmsan_memset | , |
__msan_memset | |||
) |
FEATURE | ( | kmsan | , |
"Kernel memory sanitizer" | |||
) |
void kmsan_atomic_interrupt_fence | ( | void | ) |
Definition at line 1404 of file subr_msan.c.
void kmsan_bus_dmamap_sync | ( | struct memdesc * | desc, |
bus_dmasync_op_t | op | ||
) |
Definition at line 1566 of file subr_msan.c.
References kmsan_check(), kmsan_check_bio(), kmsan_check_ccb(), kmsan_check_mbuf(), kmsan_mark(), kmsan_mark_bio(), kmsan_mark_ccb(), kmsan_mark_mbuf(), and kmsan_panic.
void kmsan_bus_space_barrier | ( | bus_space_tag_t | tag, |
bus_space_handle_t | hnd, | ||
bus_size_t | offset, | ||
bus_size_t | size, | ||
int | flags | ||
) |
Definition at line 1444 of file subr_msan.c.
References flags.
void kmsan_bus_space_free | ( | bus_space_tag_t | tag, |
bus_space_handle_t | hnd, | ||
bus_size_t | size | ||
) |
Definition at line 1437 of file subr_msan.c.
int kmsan_bus_space_map | ( | bus_space_tag_t | tag, |
bus_addr_t | hnd, | ||
bus_size_t | size, | ||
int | flags, | ||
bus_space_handle_t * | handlep | ||
) |
Definition at line 1416 of file subr_msan.c.
References flags.
int kmsan_bus_space_subregion | ( | bus_space_tag_t | tag, |
bus_space_handle_t | hnd, | ||
bus_size_t | offset, | ||
bus_size_t | size, | ||
bus_space_handle_t * | handlep | ||
) |
Definition at line 1430 of file subr_msan.c.
void kmsan_bus_space_unmap | ( | bus_space_tag_t | tag, |
bus_space_handle_t | hnd, | ||
bus_size_t | size | ||
) |
Definition at line 1423 of file subr_msan.c.
int kmsan_casueword | ( | volatile u_long * | base, |
u_long | oldval, | ||
u_long * | oldvalp, | ||
u_long | newval | ||
) |
Definition at line 1100 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_fill().
int kmsan_casueword32 | ( | volatile uint32_t * | base, |
uint32_t | oldval, | ||
uint32_t * | oldvalp, | ||
uint32_t | newval | ||
) |
Definition at line 1085 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_fill().
void kmsan_check | ( | const void * | p, |
size_t | sz, | ||
const char * | descr | ||
) |
Definition at line 605 of file subr_msan.c.
References kmsan_shadow_check().
Referenced by kmsan_bus_dmamap_sync(), and kmsan_check_ccb().
|
static |
Definition at line 417 of file subr_msan.c.
References kmsan_td::ctx, kmsan_report_hook(), msan_tls_t::param_shadow, and kmsan_td::tls.
Referenced by kmsan_casueword(), kmsan_casueword32(), kmsan_copyin(), kmsan_copyinstr(), kmsan_copyout(), kmsan_fubyte(), kmsan_fueword(), kmsan_fueword32(), kmsan_fueword64(), kmsan_fuword16(), kmsan_memcmp(), kmsan_strcmp(), kmsan_strcpy(), kmsan_strlen(), kmsan_subyte(), kmsan_suword(), kmsan_suword16(), kmsan_suword32(), and kmsan_suword64().
void kmsan_check_bio | ( | const struct bio * | bp, |
const char * | descr | ||
) |
Definition at line 611 of file subr_msan.c.
References kmsan_shadow_check().
Referenced by kmsan_bus_dmamap_sync().
void kmsan_check_ccb | ( | const union ccb * | ccb, |
const char * | descr | ||
) |
Definition at line 617 of file subr_msan.c.
References kmsan_check(), and kmsan_panic.
Referenced by kmsan_bus_dmamap_sync().
void kmsan_check_mbuf | ( | const struct mbuf * | m, |
const char * | descr | ||
) |
Definition at line 650 of file subr_msan.c.
References kmsan_shadow_check().
Referenced by kmsan_bus_dmamap_sync().
int kmsan_copyin | ( | const void * | uaddr, |
void * | kaddr, | ||
size_t | len | ||
) |
Definition at line 921 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_fill().
int kmsan_copyinstr | ( | const void * | uaddr, |
void * | kaddr, | ||
size_t | len, | ||
size_t * | done | ||
) |
Definition at line 945 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_fill().
int kmsan_copyout | ( | const void * | kaddr, |
void * | uaddr, | ||
size_t | len | ||
) |
Definition at line 935 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_check().
int kmsan_fubyte | ( | volatile const void * | base | ) |
Definition at line 966 of file subr_msan.c.
References kmsan_check_arg(), and kmsan_init_ret().
int kmsan_fueword | ( | volatile const void * | base, |
long * | val | ||
) |
Definition at line 988 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_fill().
int kmsan_fueword32 | ( | volatile const void * | base, |
int32_t * | val | ||
) |
Definition at line 1002 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_fill().
int kmsan_fueword64 | ( | volatile const void * | base, |
int64_t * | val | ||
) |
Definition at line 1016 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_fill().
int kmsan_fuword16 | ( | volatile const void * | base | ) |
Definition at line 977 of file subr_msan.c.
References kmsan_check_arg(), and kmsan_init_ret().
void kmsan_init | ( | void | ) |
Definition at line 658 of file subr_msan.c.
References kmsan_td::ctx, and msan_thread0.
void kmsan_init_arg | ( | size_t | n | ) |
Definition at line 387 of file subr_msan.c.
References kmsan_td::ctx, msan_tls_t::param_shadow, and kmsan_td::tls.
Referenced by kmsan_thread_alloc(), and kmsan_thread_free().
void kmsan_init_ret | ( | size_t | n | ) |
Definition at line 402 of file subr_msan.c.
References kmsan_td::ctx, msan_tls_t::retval_shadow, and kmsan_td::tls.
Referenced by kmsan_casueword(), kmsan_casueword32(), kmsan_copyin(), kmsan_copyinstr(), kmsan_copyout(), kmsan_fubyte(), kmsan_fueword(), kmsan_fueword32(), kmsan_fueword64(), kmsan_fuword16(), kmsan_memcmp(), kmsan_memcpy(), kmsan_memmove(), kmsan_memset(), kmsan_strcmp(), kmsan_strcpy(), kmsan_strlen(), kmsan_subyte(), kmsan_suword(), kmsan_suword16(), kmsan_suword32(), and kmsan_suword64().
void kmsan_intr_enter | ( | void | ) |
Definition at line 483 of file subr_msan.c.
References kmsan_td::ctx, kmsan_panic, and MSAN_NCONTEXT.
void kmsan_intr_leave | ( | void | ) |
Definition at line 497 of file subr_msan.c.
References kmsan_td::ctx, and kmsan_panic.
void kmsan_mark | ( | const void * | addr, |
size_t | size, | ||
uint8_t | c | ||
) |
Definition at line 547 of file subr_msan.c.
References addr, and kmsan_shadow_fill().
Referenced by ast(), fork_exit(), kmsan_bus_dmamap_sync(), kmsan_mark_bio(), kmsan_mark_ccb(), kmsan_mark_mbuf(), kmsan_thread_alloc(), malloc(), and malloc_domainset().
void kmsan_mark_bio | ( | const struct bio * | bp, |
uint8_t | c | ||
) |
Definition at line 553 of file subr_msan.c.
References kmsan_mark().
Referenced by kmsan_bus_dmamap_sync().
|
static |
Definition at line 559 of file subr_msan.c.
References kmsan_mark(), and kmsan_panic.
Referenced by kmsan_bus_dmamap_sync().
void kmsan_mark_mbuf | ( | const struct mbuf * | m, |
uint8_t | c | ||
) |
Definition at line 595 of file subr_msan.c.
References kmsan_mark().
Referenced by kmsan_bus_dmamap_sync().
int kmsan_memcmp | ( | const void * | b1, |
const void * | b2, | ||
size_t | len | ||
) |
Definition at line 800 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_check().
void * kmsan_memcpy | ( | void * | dst, |
const void * | src, | ||
size_t | len | ||
) |
Definition at line 789 of file subr_msan.c.
References kmsan_init_ret(), kmsan_meta_copy(), and src.
void * kmsan_memmove | ( | void * | dst, |
const void * | src, | ||
size_t | len | ||
) |
Definition at line 833 of file subr_msan.c.
References kmsan_init_ret(), kmsan_meta_copy(), and src.
void * kmsan_memset | ( | void * | dst, |
int | c, | ||
size_t | len | ||
) |
Definition at line 824 of file subr_msan.c.
References kmsan_init_ret(), and kmsan_shadow_fill().
Referenced by kmsan_thread_alloc().
|
inlinestatic |
Definition at line 335 of file subr_msan.c.
References kmsan_shadow_fill(), MSAN_ORIG_MASK, and src.
Referenced by kmsan_memcpy(), and kmsan_memmove().
|
inlinestatic |
Definition at line 279 of file subr_msan.c.
References addr, MSAN_ORIG_MASK, msan_meta_t::orig, and msan_meta_t::shad.
Referenced by __msan_metadata_ptr_for_load_n(), and __msan_metadata_ptr_for_store_n().
void kmsan_orig | ( | const void * | addr, |
size_t | size, | ||
int | type, | ||
uintptr_t | pc | ||
) |
Definition at line 538 of file subr_msan.c.
References addr, kmsan_origin_fill(), and type.
Referenced by malloc(), and malloc_domainset().
|
inlinestatic |
Definition at line 154 of file subr_msan.c.
References type.
Referenced by kmsan_report_hook(), and kmsan_report_inline().
|
inlinestatic |
Definition at line 301 of file subr_msan.c.
References addr, and MSAN_ORIG_MASK.
Referenced by __msan_poison_alloca(), and kmsan_orig().
|
static |
Definition at line 171 of file subr_msan.c.
References addr, buf, kdb_active, kmsan_orig_name(), kmsan_reporting, linker_ddb_search_symbol_name(), MSAN_ORIG_MASK, panicstr, REPORT, and type.
Referenced by kmsan_check_arg(), and kmsan_shadow_check().
|
static |
Definition at line 228 of file subr_msan.c.
References buf, kdb_active, kmsan_orig_name(), kmsan_reporting, linker_ddb_search_symbol_name(), panicstr, REPORT, and type.
Referenced by __msan_warning().
|
inlinestatic |
Definition at line 367 of file subr_msan.c.
References addr, and kmsan_report_hook().
Referenced by kmsan_check(), kmsan_check_bio(), kmsan_check_mbuf(), kmsan_copyout(), kmsan_memcmp(), kmsan_strcmp(), kmsan_strcpy(), and kmsan_strlen().
|
inlinestatic |
Definition at line 321 of file subr_msan.c.
References addr.
Referenced by __msan_instrument_asm_store(), __msan_poison(), __msan_poison_alloca(), __msan_unpoison(), __msan_unpoison_alloca(), kmsan_casueword(), kmsan_casueword32(), kmsan_copyin(), kmsan_copyinstr(), kmsan_fueword(), kmsan_fueword32(), kmsan_fueword64(), kmsan_mark(), kmsan_memset(), kmsan_meta_copy(), and kmsan_strcpy().
void kmsan_shadow_map | ( | vm_offset_t | addr, |
size_t | size | ||
) |
Definition at line 513 of file subr_msan.c.
References addr.
int kmsan_strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Definition at line 871 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_check().
char * kmsan_strcpy | ( | char * | dst, |
const char * | src | ||
) |
Definition at line 848 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), kmsan_shadow_check(), kmsan_shadow_fill(), and src.
size_t kmsan_strlen | ( | const char * | str | ) |
Definition at line 898 of file subr_msan.c.
References kmsan_check_arg(), kmsan_init_ret(), and kmsan_shadow_check().
int kmsan_subyte | ( | volatile void * | base, |
int | byte | ||
) |
Definition at line 1030 of file subr_msan.c.
References kmsan_check_arg(), and kmsan_init_ret().
int kmsan_suword | ( | volatile void * | base, |
long | word | ||
) |
Definition at line 1041 of file subr_msan.c.
References kmsan_check_arg(), and kmsan_init_ret().
int kmsan_suword16 | ( | volatile void * | base, |
int | word | ||
) |
Definition at line 1052 of file subr_msan.c.
References kmsan_check_arg(), and kmsan_init_ret().
int kmsan_suword32 | ( | volatile void * | base, |
int32_t | word | ||
) |
Definition at line 1063 of file subr_msan.c.
References kmsan_check_arg(), and kmsan_init_ret().
int kmsan_suword64 | ( | volatile void * | base, |
int64_t | word | ||
) |
Definition at line 1074 of file subr_msan.c.
References kmsan_check_arg(), and kmsan_init_ret().
void kmsan_thread_alloc | ( | struct thread * | td | ) |
Definition at line 439 of file subr_msan.c.
References kmsan_td::ctx, kmsan_init_arg(), kmsan_mark(), kmsan_memset(), and malloc().
Referenced by fork1(), and thread_alloc().
void kmsan_thread_free | ( | struct thread * | td | ) |
Definition at line 464 of file subr_msan.c.
References free(), kmsan_init_arg(), and kmsan_panic.
Referenced by thread_free_batched().
|
static |
MSAN_ATOMIC_FUNC_ADD | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_ADD | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_ADD | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_ADD | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_ADD | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_ADD | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_ADD | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_CLEAR | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_CLEAR | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_CLEAR | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_CLEAR | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_CLEAR | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_CLEAR | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_CLEAR | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_CMPSET | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_CMPSET | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_CMPSET | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_CMPSET | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_CMPSET | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_CMPSET | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_CMPSET | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_FCMPSET | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_FCMPSET | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_FCMPSET | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_FCMPSET | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_FCMPSET | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_FCMPSET | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_FCMPSET | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_FETCHADD | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_FETCHADD | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_FETCHADD | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_FETCHADD | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | char | , |
u_char | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_LOAD | ( | short | , |
u_short | |||
) |
MSAN_ATOMIC_FUNC_READANDCLEAR | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_READANDCLEAR | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_READANDCLEAR | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_READANDCLEAR | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_READANDCLEAR | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_SET | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_SET | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_SET | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_SET | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_SET | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_SET | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_SET | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | char | , |
u_char | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_STORE | ( | short | , |
u_short | |||
) |
MSAN_ATOMIC_FUNC_SUBTRACT | ( | 16 | , |
uint16_t | |||
) |
MSAN_ATOMIC_FUNC_SUBTRACT | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_SUBTRACT | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_SUBTRACT | ( | 8 | , |
uint8_t | |||
) |
MSAN_ATOMIC_FUNC_SUBTRACT | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_SUBTRACT | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_SUBTRACT | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_SWAP | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_SWAP | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_SWAP | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_SWAP | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_SWAP | ( | ptr | , |
uintptr_t | |||
) |
MSAN_ATOMIC_FUNC_TESTANDCLEAR | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_TESTANDCLEAR | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_TESTANDCLEAR | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_TESTANDCLEAR | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_TESTANDSET | ( | 32 | , |
uint32_t | |||
) |
MSAN_ATOMIC_FUNC_TESTANDSET | ( | 64 | , |
uint64_t | |||
) |
MSAN_ATOMIC_FUNC_TESTANDSET | ( | int | , |
u_int | |||
) |
MSAN_ATOMIC_FUNC_TESTANDSET | ( | long | , |
u_long | |||
) |
MSAN_ATOMIC_FUNC_THREAD_FENCE | ( | acq | ) |
MSAN_ATOMIC_FUNC_THREAD_FENCE | ( | acq_rel | ) |
MSAN_ATOMIC_FUNC_THREAD_FENCE | ( | rel | ) |
MSAN_ATOMIC_FUNC_THREAD_FENCE | ( | seq_cst | ) |
SYSCTL_BOOL | ( | _debug_kmsan | , |
OID_AUTO | , | ||
panic_on_violation | , | ||
CTLFLAG_RWTUN | , | ||
& | panic_on_violation, | ||
0 | , | ||
"Panic if an invalid access is detected" | |||
) |
|
static |
|
static |
Definition at line 115 of file subr_msan.c.
|
static |
Definition at line 105 of file subr_msan.c.
Referenced by __msan_get_context_state().
|
static |
Definition at line 117 of file subr_msan.c.
Referenced by kmsan_report_hook(), and kmsan_report_inline().
|
static |
Definition at line 114 of file subr_msan.c.
Referenced by kmsan_init().
|
static |
Definition at line 144 of file subr_msan.c.