#include <linux/debug_locks.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/kallsyms.h>
#include <linux/kernel.h>
#include <linux/lockdep.h>
#include <linux/preempt.h>
#include <linux/printk.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/stacktrace.h>
#include "kcsan.h"
#include "encoding.h"
#define NUM_STACK_ENTRIES …
struct access_info { … };
struct other_info { … };
static struct other_info other_infos[CONFIG_KCSAN_NUM_WATCHPOINTS + NUM_SLOTS-1];
struct report_time { … };
#define REPORT_TIMES_MAX …
#define REPORT_TIMES_SIZE …
static struct report_time report_times[REPORT_TIMES_SIZE];
static DEFINE_RAW_SPINLOCK(report_lock);
static bool rate_limit_report(unsigned long frame1, unsigned long frame2)
{ … }
static bool
skip_report(enum kcsan_value_change value_change, unsigned long top_frame)
{ … }
static const char *get_access_type(int type)
{ … }
static const char *get_bug_type(int type)
{ … }
static const char *get_thread_desc(int task_id)
{ … }
static int get_stack_skipnr(const unsigned long stack_entries[], int num_entries)
{ … }
static int
replace_stack_entry(unsigned long stack_entries[], int num_entries, unsigned long ip,
unsigned long *replaced)
{ … }
static int
sanitize_stack_entries(unsigned long stack_entries[], int num_entries, unsigned long ip,
unsigned long *replaced)
{ … }
static int sym_strcmp(void *addr1, void *addr2)
{ … }
static void
print_stack_trace(unsigned long stack_entries[], int num_entries, unsigned long reordered_to)
{ … }
static void print_verbose_info(struct task_struct *task)
{ … }
static void print_report(enum kcsan_value_change value_change,
const struct access_info *ai,
struct other_info *other_info,
u64 old, u64 new, u64 mask)
{ … }
static void release_report(unsigned long *flags, struct other_info *other_info)
{ … }
static void set_other_info_task_blocking(unsigned long *flags,
const struct access_info *ai,
struct other_info *other_info)
{ … }
static void prepare_report_producer(unsigned long *flags,
const struct access_info *ai,
struct other_info *other_info)
{ … }
static bool prepare_report_consumer(unsigned long *flags,
const struct access_info *ai,
struct other_info *other_info)
{ … }
static struct access_info prepare_access_info(const volatile void *ptr, size_t size,
int access_type, unsigned long ip)
{ … }
void kcsan_report_set_info(const volatile void *ptr, size_t size, int access_type,
unsigned long ip, int watchpoint_idx)
{ … }
void kcsan_report_known_origin(const volatile void *ptr, size_t size, int access_type,
unsigned long ip, enum kcsan_value_change value_change,
int watchpoint_idx, u64 old, u64 new, u64 mask)
{ … }
void kcsan_report_unknown_origin(const volatile void *ptr, size_t size, int access_type,
unsigned long ip, u64 old, u64 new, u64 mask)
{ … }