FreeBSD kernel kern code
subr_csan.c File Reference
#include "opt_ddb.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/cpu.h>
#include <sys/csan.h>
#include <sys/proc.h>
#include <sys/smp.h>
#include <sys/systm.h>
#include <ddb/ddb.h>
#include <ddb/db_sym.h>
#include <machine/csan.h>
#include <machine/atomic.h>
#include <sys/atomic_san.h>
#include <machine/bus.h>
#include <sys/bus_san.h>
Include dependency graph for subr_csan.c:

Go to the source code of this file.

Data Structures

struct  csan_cell_t
 
struct  csan_cpu_t
 

Macros

#define SAN_RUNTIME
 
#define REPORT   printf
 
#define __RET_ADDR   (uintptr_t)__builtin_return_address(0)
 
#define KCSAN_NACCESSES   1024
 
#define KCSAN_DELAY   10 /* 10 microseconds */
 
#define CSAN_READ(size)
 
#define CSAN_WRITE(size)
 
#define _CSAN_ATOMIC_FUNC_ADD(name, type)
 
#define CSAN_ATOMIC_FUNC_ADD(name, type)
 
#define _CSAN_ATOMIC_FUNC_CLEAR(name, type)
 
#define CSAN_ATOMIC_FUNC_CLEAR(name, type)
 
#define _CSAN_ATOMIC_FUNC_CMPSET(name, type)
 
#define CSAN_ATOMIC_FUNC_CMPSET(name, type)
 
#define _CSAN_ATOMIC_FUNC_FCMPSET(name, type)
 
#define CSAN_ATOMIC_FUNC_FCMPSET(name, type)
 
#define CSAN_ATOMIC_FUNC_FETCHADD(name, type)
 
#define _CSAN_ATOMIC_FUNC_LOAD(name, type)
 
#define CSAN_ATOMIC_FUNC_LOAD(name, type)
 
#define CSAN_ATOMIC_FUNC_READANDCLEAR(name, type)
 
#define _CSAN_ATOMIC_FUNC_SET(name, type)
 
#define CSAN_ATOMIC_FUNC_SET(name, type)
 
#define _CSAN_ATOMIC_FUNC_SUBTRACT(name, type)
 
#define CSAN_ATOMIC_FUNC_SUBTRACT(name, type)
 
#define _CSAN_ATOMIC_FUNC_STORE(name, type)
 
#define CSAN_ATOMIC_FUNC_STORE(name, type)
 
#define CSAN_ATOMIC_FUNC_SWAP(name, type)
 
#define CSAN_ATOMIC_FUNC_TESTANDCLEAR(name, type)
 
#define CSAN_ATOMIC_FUNC_TESTANDSET(name, type)
 
#define CSAN_ATOMIC_FUNC_THREAD_FENCE(name)
 
#define CSAN_BUS_READ_FUNC(func, width, type)
 
#define CSAN_BUS_READ_PTR_FUNC(func, width, type)
 
#define CSAN_BUS_WRITE_FUNC(func, width, type)
 
#define CSAN_BUS_WRITE_PTR_FUNC(func, width, type)
 
#define CSAN_BUS_SET_FUNC(func, width, type)
 
#define CSAN_BUS_PEEK_FUNC(width, type)
 
#define CSAN_BUS_POKE_FUNC(width, type)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static void kcsan_enable (void *dummy __unused)
 
 SYSINIT (kcsan_enable, SI_SUB_SMP, SI_ORDER_SECOND, kcsan_enable, NULL)
 
void kcsan_cpu_init (u_int cpu)
 
static void kcsan_report (csan_cell_t *new, u_int newcpu, csan_cell_t *old, u_int oldcpu)
 
static bool kcsan_access_is_atomic (csan_cell_t *new, csan_cell_t *old)
 
static void kcsan_access (uintptr_t addr, size_t size, bool write, bool atomic, uintptr_t pc)
 
void __tsan_read_range (uintptr_t, size_t)
 
void __tsan_write_range (uintptr_t, size_t)
 
void __tsan_init (void)
 
void __tsan_func_entry (void *)
 
void __tsan_func_exit (void)
 
void * kcsan_memcpy (void *dst, const void *src, size_t len)
 
int kcsan_memcmp (const void *b1, const void *b2, size_t len)
 
void * kcsan_memset (void *b, int c, size_t len)
 
void * kcsan_memmove (void *dst, const void *src, size_t len)
 
char * kcsan_strcpy (char *dst, const char *src)
 
int kcsan_strcmp (const char *s1, const char *s2)
 
size_t kcsan_strlen (const char *str)
 
int kcsan_copyin (const void *uaddr, void *kaddr, size_t len)
 
int kcsan_copyinstr (const void *uaddr, void *kaddr, size_t len, size_t *done)
 
int kcsan_copyout (const void *kaddr, void *uaddr, size_t len)
 
void kcsan_atomic_interrupt_fence (void)
 
int kcsan_bus_space_map (bus_space_tag_t tag, bus_addr_t hnd, bus_size_t size, int flags, bus_space_handle_t *handlep)
 
void kcsan_bus_space_unmap (bus_space_tag_t tag, bus_space_handle_t hnd, bus_size_t size)
 
int kcsan_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)
 
int kcsan_bus_space_alloc (bus_space_tag_t tag, bus_addr_t reg_start, bus_addr_t reg_end, bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *addrp, bus_space_handle_t *handlep)
 
void kcsan_bus_space_free (bus_space_tag_t tag, bus_space_handle_t hnd, bus_size_t size)
 
void kcsan_bus_space_barrier (bus_space_tag_t tag, bus_space_handle_t hnd, bus_size_t offset, bus_size_t size, int flags)
 

Variables

static csan_cpu_t kcsan_cpus [MAXCPU]
 
static bool kcsan_enabled __read_mostly
 

Macro Definition Documentation

◆ __RET_ADDR

#define __RET_ADDR   (uintptr_t)__builtin_return_address(0)

Definition at line 76 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_ADD

#define _CSAN_ATOMIC_FUNC_ADD (   name,
  type 
)
Value:
void kcsan_atomic_add_##name(volatile type *ptr, type val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
atomic_add_##name(ptr, val); \
}
device_property_type_t type
Definition: bus_if.m:941
const char * name
Definition: kern_fail.c:145
#define __RET_ADDR
Definition: subr_csan.c:76

Definition at line 379 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_CLEAR

#define _CSAN_ATOMIC_FUNC_CLEAR (   name,
  type 
)
Value:
void kcsan_atomic_clear_##name(volatile type *ptr, type val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
atomic_clear_##name(ptr, val); \
}

Definition at line 392 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_CMPSET

#define _CSAN_ATOMIC_FUNC_CMPSET (   name,
  type 
)
Value:
int kcsan_atomic_cmpset_##name(volatile type *ptr, type val1, \
type val2) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
return (atomic_cmpset_##name(ptr, val1, val2)); \
}

Definition at line 405 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_FCMPSET

#define _CSAN_ATOMIC_FUNC_FCMPSET (   name,
  type 
)
Value:
int kcsan_atomic_fcmpset_##name(volatile type *ptr, type *val1, \
type val2) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
return (atomic_fcmpset_##name(ptr, val1, val2)); \
}

Definition at line 419 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_LOAD

#define _CSAN_ATOMIC_FUNC_LOAD (   name,
  type 
)
Value:
type kcsan_atomic_load_##name(volatile type *ptr) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), false, true, \
return (atomic_load_##name(ptr)); \
}

Definition at line 441 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_SET

#define _CSAN_ATOMIC_FUNC_SET (   name,
  type 
)
Value:
void kcsan_atomic_set_##name(volatile type *ptr, type val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
atomic_set_##name(ptr, val); \
}

Definition at line 461 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_STORE

#define _CSAN_ATOMIC_FUNC_STORE (   name,
  type 
)
Value:
void kcsan_atomic_store_##name(volatile type *ptr, type val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
atomic_store_##name(ptr, val); \
}

Definition at line 487 of file subr_csan.c.

◆ _CSAN_ATOMIC_FUNC_SUBTRACT

#define _CSAN_ATOMIC_FUNC_SUBTRACT (   name,
  type 
)
Value:
void kcsan_atomic_subtract_##name(volatile type *ptr, type val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
atomic_subtract_##name(ptr, val); \
}

Definition at line 474 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_ADD

#define CSAN_ATOMIC_FUNC_ADD (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_ADD(acq_##name, type) \
_CSAN_ATOMIC_FUNC_ADD(rel_##name, type)
#define _CSAN_ATOMIC_FUNC_ADD(name, type)
Definition: subr_csan.c:379

Definition at line 387 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_CLEAR

#define CSAN_ATOMIC_FUNC_CLEAR (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_CLEAR(acq_##name, type) \
_CSAN_ATOMIC_FUNC_CLEAR(rel_##name, type)
#define _CSAN_ATOMIC_FUNC_CLEAR(name, type)
Definition: subr_csan.c:392

Definition at line 400 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_CMPSET

#define CSAN_ATOMIC_FUNC_CMPSET (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_CMPSET(acq_##name, type) \
_CSAN_ATOMIC_FUNC_CMPSET(rel_##name, type)
#define _CSAN_ATOMIC_FUNC_CMPSET(name, type)
Definition: subr_csan.c:405

Definition at line 414 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_FCMPSET

#define CSAN_ATOMIC_FUNC_FCMPSET (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_FCMPSET(acq_##name, type) \
_CSAN_ATOMIC_FUNC_FCMPSET(rel_##name, type)
#define _CSAN_ATOMIC_FUNC_FCMPSET(name, type)
Definition: subr_csan.c:419

Definition at line 428 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_FETCHADD

#define CSAN_ATOMIC_FUNC_FETCHADD (   name,
  type 
)
Value:
type kcsan_atomic_fetchadd_##name(volatile type *ptr, type val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
return (atomic_fetchadd_##name(ptr, val)); \
}

Definition at line 433 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_LOAD

#define CSAN_ATOMIC_FUNC_LOAD (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_LOAD(acq_##name, type) \
#define _CSAN_ATOMIC_FUNC_LOAD(name, type)
Definition: subr_csan.c:441

Definition at line 449 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_READANDCLEAR

#define CSAN_ATOMIC_FUNC_READANDCLEAR (   name,
  type 
)
Value:
type kcsan_atomic_readandclear_##name(volatile type *ptr) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
return (atomic_readandclear_##name(ptr)); \
}

Definition at line 453 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_SET

#define CSAN_ATOMIC_FUNC_SET (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_SET(acq_##name, type) \
_CSAN_ATOMIC_FUNC_SET(rel_##name, type)
#define _CSAN_ATOMIC_FUNC_SET(name, type)
Definition: subr_csan.c:461

Definition at line 469 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_STORE

#define CSAN_ATOMIC_FUNC_STORE (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_STORE(rel_##name, type)
#define _CSAN_ATOMIC_FUNC_STORE(name, type)
Definition: subr_csan.c:487

Definition at line 495 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_SUBTRACT

#define CSAN_ATOMIC_FUNC_SUBTRACT (   name,
  type 
)
Value:
_CSAN_ATOMIC_FUNC_SUBTRACT(acq_##name, type) \
_CSAN_ATOMIC_FUNC_SUBTRACT(rel_##name, type)
#define _CSAN_ATOMIC_FUNC_SUBTRACT(name, type)
Definition: subr_csan.c:474

Definition at line 482 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_SWAP

#define CSAN_ATOMIC_FUNC_SWAP (   name,
  type 
)
Value:
type kcsan_atomic_swap_##name(volatile type *ptr, type val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
return(atomic_swap_##name(ptr, val)); \
}

Definition at line 499 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_TESTANDCLEAR

#define CSAN_ATOMIC_FUNC_TESTANDCLEAR (   name,
  type 
)
Value:
int kcsan_atomic_testandclear_##name(volatile type *ptr, u_int val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
return(atomic_testandclear_##name(ptr, val)); \
}

Definition at line 507 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_TESTANDSET

#define CSAN_ATOMIC_FUNC_TESTANDSET (   name,
  type 
)
Value:
int kcsan_atomic_testandset_##name(volatile type *ptr, u_int val) \
{ \
kcsan_access((uintptr_t)ptr, sizeof(type), true, true, \
return (atomic_testandset_##name(ptr, val)); \
}

Definition at line 515 of file subr_csan.c.

◆ CSAN_ATOMIC_FUNC_THREAD_FENCE

#define CSAN_ATOMIC_FUNC_THREAD_FENCE (   name)
Value:
void kcsan_atomic_thread_fence_##name(void) \
{ \
atomic_thread_fence_##name(); \
}

Definition at line 662 of file subr_csan.c.

◆ CSAN_BUS_PEEK_FUNC

#define CSAN_BUS_PEEK_FUNC (   width,
  type 
)
Value:
int kcsan_bus_space_peek_##width(bus_space_tag_t tag, \
bus_space_handle_t hnd, bus_size_t offset, type *value) \
{ \
kcsan_access((uintptr_t)value, sizeof(type), true, false, \
return (bus_space_peek_##width(tag, hnd, offset, value)); \
}
caddr_t value
Definition: linker_if.m:63

Definition at line 874 of file subr_csan.c.

◆ CSAN_BUS_POKE_FUNC

#define CSAN_BUS_POKE_FUNC (   width,
  type 
)
Value:
int kcsan_bus_space_poke_##width(bus_space_tag_t tag, \
bus_space_handle_t hnd, bus_size_t offset, type value) \
{ \
return (bus_space_poke_##width(tag, hnd, offset, value)); \
}

Definition at line 890 of file subr_csan.c.

◆ CSAN_BUS_READ_FUNC

#define CSAN_BUS_READ_FUNC (   func,
  width,
  type 
)
Value:
type kcsan_bus_space_read##func##_##width(bus_space_tag_t tag, \
bus_space_handle_t hnd, bus_size_t offset) \
{ \
return (bus_space_read##func##_##width(tag, hnd, \
offset)); \
} \

Definition at line 738 of file subr_csan.c.

◆ CSAN_BUS_READ_PTR_FUNC

#define CSAN_BUS_READ_PTR_FUNC (   func,
  width,
  type 
)
Value:
void kcsan_bus_space_read_##func##_##width(bus_space_tag_t tag, \
bus_space_handle_t hnd, bus_size_t size, type *buf, \
bus_size_t count) \
{ \
kcsan_access((uintptr_t)buf, sizeof(type) * count, \
false, false, __RET_ADDR); \
bus_space_read_##func##_##width(tag, hnd, size, buf, \
count); \
}
int * count
Definition: cpufreq_if.m:63
struct stat * buf

Definition at line 746 of file subr_csan.c.

◆ CSAN_BUS_SET_FUNC

#define CSAN_BUS_SET_FUNC (   func,
  width,
  type 
)
Value:
void kcsan_bus_space_set_##func##_##width(bus_space_tag_t tag, \
bus_space_handle_t hnd, bus_size_t offset, type value, \
bus_size_t count) \
{ \
bus_space_set_##func##_##width(tag, hnd, offset, value, \
count); \
}

Definition at line 835 of file subr_csan.c.

◆ CSAN_BUS_WRITE_FUNC

#define CSAN_BUS_WRITE_FUNC (   func,
  width,
  type 
)
Value:
void kcsan_bus_space_write##func##_##width(bus_space_tag_t tag, \
bus_space_handle_t hnd, bus_size_t offset, type value) \
{ \
bus_space_write##func##_##width(tag, hnd, offset, value); \
} \

Definition at line 787 of file subr_csan.c.

◆ CSAN_BUS_WRITE_PTR_FUNC

#define CSAN_BUS_WRITE_PTR_FUNC (   func,
  width,
  type 
)
Value:
void kcsan_bus_space_write_##func##_##width(bus_space_tag_t tag, \
bus_space_handle_t hnd, bus_size_t size, const type *buf, \
bus_size_t count) \
{ \
kcsan_access((uintptr_t)buf, sizeof(type) * count, \
true, false, __RET_ADDR); \
bus_space_write_##func##_##width(tag, hnd, size, buf, \
count); \
}

Definition at line 794 of file subr_csan.c.

◆ CSAN_READ

#define CSAN_READ (   size)
Value:
void __tsan_read##size(uintptr_t); \
void __tsan_read##size(uintptr_t addr) \
{ \
kcsan_access(addr, size, false, false, __RET_ADDR); \
} \
void __tsan_unaligned_read##size(uintptr_t); \
void __tsan_unaligned_read##size(uintptr_t addr) \
{ \
kcsan_access(addr, size, false, false, __RET_ADDR); \
}
uint64_t * addr
Definition: msi_if.m:89

Definition at line 201 of file subr_csan.c.

◆ CSAN_WRITE

#define CSAN_WRITE (   size)
Value:
void __tsan_write##size(uintptr_t); \
void __tsan_write##size(uintptr_t addr) \
{ \
kcsan_access(addr, size, true, false, __RET_ADDR); \
} \
void __tsan_unaligned_write##size(uintptr_t); \
void __tsan_unaligned_write##size(uintptr_t addr) \
{ \
kcsan_access(addr, size, true, false, __RET_ADDR); \
}

Definition at line 219 of file subr_csan.c.

◆ KCSAN_DELAY

#define KCSAN_DELAY   10 /* 10 microseconds */

Definition at line 79 of file subr_csan.c.

◆ KCSAN_NACCESSES

#define KCSAN_NACCESSES   1024

Definition at line 78 of file subr_csan.c.

◆ REPORT

#define REPORT   printf

Definition at line 56 of file subr_csan.c.

◆ SAN_RUNTIME

#define SAN_RUNTIME

Definition at line 33 of file subr_csan.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ __tsan_func_entry()

void __tsan_func_entry ( void *  call_pc)

Definition at line 262 of file subr_csan.c.

◆ __tsan_func_exit()

void __tsan_func_exit ( void  )

Definition at line 267 of file subr_csan.c.

◆ __tsan_init()

void __tsan_init ( void  )

Definition at line 257 of file subr_csan.c.

◆ __tsan_read_range()

void __tsan_read_range ( uintptr_t  addr,
size_t  size 
)

Definition at line 241 of file subr_csan.c.

References __RET_ADDR, addr, and kcsan_access().

Here is the call graph for this function:

◆ __tsan_write_range()

void __tsan_write_range ( uintptr_t  addr,
size_t  size 
)

Definition at line 247 of file subr_csan.c.

References __RET_ADDR, addr, and kcsan_access().

Here is the call graph for this function:

◆ kcsan_access()

static void kcsan_access ( uintptr_t  addr,
size_t  size,
bool  write,
bool  atomic,
uintptr_t  pc 
)
inlinestatic

◆ kcsan_access_is_atomic()

static bool kcsan_access_is_atomic ( csan_cell_t new,
csan_cell_t old 
)
inlinestatic

Definition at line 135 of file subr_csan.c.

References csan_cell_t::atomic, and csan_cell_t::write.

Referenced by kcsan_access().

Here is the caller graph for this function:

◆ kcsan_atomic_interrupt_fence()

void kcsan_atomic_interrupt_fence ( void  )

Definition at line 674 of file subr_csan.c.

◆ kcsan_bus_space_alloc()

int kcsan_bus_space_alloc ( bus_space_tag_t  tag,
bus_addr_t  reg_start,
bus_addr_t  reg_end,
bus_size_t  size,
bus_size_t  alignment,
bus_size_t  boundary,
int  flags,
bus_addr_t *  addrp,
bus_space_handle_t *  handlep 
)

Definition at line 711 of file subr_csan.c.

References flags.

◆ kcsan_bus_space_barrier()

void kcsan_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 731 of file subr_csan.c.

References flags.

◆ kcsan_bus_space_free()

void kcsan_bus_space_free ( bus_space_tag_t  tag,
bus_space_handle_t  hnd,
bus_size_t  size 
)

Definition at line 723 of file subr_csan.c.

◆ kcsan_bus_space_map()

int kcsan_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 686 of file subr_csan.c.

References flags.

◆ kcsan_bus_space_subregion()

int kcsan_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 702 of file subr_csan.c.

◆ kcsan_bus_space_unmap()

void kcsan_bus_space_unmap ( bus_space_tag_t  tag,
bus_space_handle_t  hnd,
bus_size_t  size 
)

Definition at line 694 of file subr_csan.c.

◆ kcsan_copyin()

int kcsan_copyin ( const void *  uaddr,
void *  kaddr,
size_t  len 
)

Definition at line 354 of file subr_csan.c.

References __RET_ADDR, and kcsan_access().

Here is the call graph for this function:

◆ kcsan_copyinstr()

int kcsan_copyinstr ( const void *  uaddr,
void *  kaddr,
size_t  len,
size_t *  done 
)

Definition at line 361 of file subr_csan.c.

References __RET_ADDR, and kcsan_access().

Here is the call graph for this function:

◆ kcsan_copyout()

int kcsan_copyout ( const void *  kaddr,
void *  uaddr,
size_t  len 
)

Definition at line 368 of file subr_csan.c.

References __RET_ADDR, and kcsan_access().

Here is the call graph for this function:

◆ kcsan_cpu_init()

void kcsan_cpu_init ( u_int  cpu)

Definition at line 98 of file subr_csan.c.

References csan_cpu_t::inited, and kcsan_cpus.

◆ kcsan_enable()

static void kcsan_enable ( void *dummy  __unused)
static

Definition at line 89 of file subr_csan.c.

References printf().

Here is the call graph for this function:

◆ kcsan_memcmp()

int kcsan_memcmp ( const void *  b1,
const void *  b2,
size_t  len 
)

Definition at line 282 of file subr_csan.c.

References __RET_ADDR, and kcsan_access().

Here is the call graph for this function:

◆ kcsan_memcpy()

void * kcsan_memcpy ( void *  dst,
const void *  src,
size_t  len 
)

Definition at line 274 of file subr_csan.c.

References __RET_ADDR, kcsan_access(), and src.

Here is the call graph for this function:

◆ kcsan_memmove()

void * kcsan_memmove ( void *  dst,
const void *  src,
size_t  len 
)

Definition at line 297 of file subr_csan.c.

References __RET_ADDR, kcsan_access(), and src.

Here is the call graph for this function:

◆ kcsan_memset()

void * kcsan_memset ( void *  b,
int  c,
size_t  len 
)

Definition at line 290 of file subr_csan.c.

References __RET_ADDR, and kcsan_access().

Here is the call graph for this function:

◆ kcsan_report()

static void kcsan_report ( csan_cell_t new,
u_int  newcpu,
csan_cell_t old,
u_int  oldcpu 
)
inlinestatic

Definition at line 106 of file subr_csan.c.

References csan_cell_t::addr, csan_cell_t::atomic, csan_cell_t::pc, REPORT, csan_cell_t::size, sym, and csan_cell_t::write.

Referenced by kcsan_access().

Here is the caller graph for this function:

◆ kcsan_strcmp()

int kcsan_strcmp ( const char *  s1,
const char *  s2 
)

Definition at line 322 of file subr_csan.c.

References __RET_ADDR, and kcsan_access().

Here is the call graph for this function:

◆ kcsan_strcpy()

char * kcsan_strcpy ( char *  dst,
const char *  src 
)

Definition at line 305 of file subr_csan.c.

References __RET_ADDR, kcsan_access(), and src.

Here is the call graph for this function:

◆ kcsan_strlen()

size_t kcsan_strlen ( const char *  str)

Definition at line 338 of file subr_csan.c.

References __RET_ADDR, and kcsan_access().

Here is the call graph for this function:

◆ SYSINIT()

SYSINIT ( kcsan_enable  ,
SI_SUB_SMP  ,
SI_ORDER_SECOND  ,
kcsan_enable  ,
NULL   
)

Variable Documentation

◆ __read_mostly

bool kcsan_enabled __read_mostly
static

Definition at line 74 of file subr_csan.c.

◆ kcsan_cpus

csan_cpu_t kcsan_cpus[MAXCPU]
static

Definition at line 73 of file subr_csan.c.

Referenced by kcsan_access(), and kcsan_cpu_init().