28 lines
712 B
C
28 lines
712 B
C
#include <linux/list.h>
|
|
|
|
// for memory access
|
|
// #include <linux/sched.h>
|
|
|
|
typedef struct {
|
|
int __user *user_ptr_len;
|
|
size_t __user user_buf_len;
|
|
void __user *user_buf;
|
|
} ioctl_dump_param; // for ioctl_num 1;
|
|
|
|
typedef struct {
|
|
pid_t task_id; // current process id
|
|
struct page *page;
|
|
void *kaddr;
|
|
struct list_head entry;
|
|
} watch_local_memory;
|
|
|
|
// Global variable
|
|
static LIST_HEAD(watch_local_memory_list);
|
|
|
|
void *convert_user_space_ptr(pid_t pid, unsigned long kaddr);
|
|
void free_page_list(pid_t task_id);
|
|
void free_all_page_list(void);
|
|
|
|
unsigned char read_and_compare(void *ptr, int len, unsigned char above_threshold,
|
|
unsigned char is_unsigned, long long threshold);
|