summaryrefslogtreecommitdiff
path: root/source/module
diff options
context:
space:
mode:
authorzy <[email protected]>2023-11-22 22:53:42 -0500
committerzy <[email protected]>2023-11-22 22:53:42 -0500
commit1ba029a6b843b11bb1106d263ff2df8a7c98ed14 (patch)
tree82559080fb530785b25d4f6ebabe322f7e4c7db1 /source/module
parentaa6eb1cfca7ed90eb40a4a10f61850ae638bd5ef (diff)
orig_find_task_by_vpid
Diffstat (limited to 'source/module')
-rw-r--r--source/module/monitor_kallsyms.c3
-rw-r--r--source/module/monitor_kallsyms.h3
-rw-r--r--source/module/monitor_trace.h3
3 files changed, 8 insertions, 1 deletions
diff --git a/source/module/monitor_kallsyms.c b/source/module/monitor_kallsyms.c
index ae2ea95..412088f 100644
--- a/source/module/monitor_kallsyms.c
+++ b/source/module/monitor_kallsyms.c
@@ -16,6 +16,8 @@ int (*orig_get_task_type)(struct sched_entity *se);
int (*orig_kernfs_name)(struct kernfs_node *kn, char *buf, size_t buflen);
int (*orig_access_remote_vm)(struct mm_struct *mm, unsigned long addr,
void *buf, int len, unsigned int gup_flags);
+struct task_struct *(*orig_find_task_by_vpid)(pid_t nr);
+
/// @brief init kallsyms_lookup_name,all orig_fun are depend on it
/// @param
@@ -55,5 +57,6 @@ int init_orig_fun(void) {
LOOKUP_SYMS_NORET(
get_task_type); // get_task_type | this fun is not available on 5.17.15
LOOKUP_SYMS_NORET(kernfs_name); // kernfs_name
+ LOOKUP_SYMS_NORET(find_task_by_vpid);
return 0;
}
diff --git a/source/module/monitor_kallsyms.h b/source/module/monitor_kallsyms.h
index d127e4a..9df89f0 100644
--- a/source/module/monitor_kallsyms.h
+++ b/source/module/monitor_kallsyms.h
@@ -41,4 +41,5 @@ extern int (*orig_get_task_type)(struct sched_entity *se);
extern int (*orig_kernfs_name)(struct kernfs_node *kn, char *buf,
size_t buflen);
extern int (*orig_access_remote_vm)(struct mm_struct *mm, unsigned long addr,
- void *buf, int len, unsigned int gup_flags); \ No newline at end of file
+ void *buf, int len, unsigned int gup_flags);
+extern struct task_struct *(*orig_find_task_by_vpid)(pid_t nr); \ No newline at end of file
diff --git a/source/module/monitor_trace.h b/source/module/monitor_trace.h
index 6ff3abf..1938862 100644
--- a/source/module/monitor_trace.h
+++ b/source/module/monitor_trace.h
@@ -113,6 +113,8 @@ void dump_proc_chains_argv(
int style, struct task_struct *tsk, mm_tree *mm_tree,
proc_chains_detail *detail); // get process chains argv
+void diag_test(int nid); // for test
+
// print
// void diag_printf_kern_stack(kern_stack_detail *kern_stack);
// void diag_printf_kern_stack(kern_stack_detail *kern_stack, int reverse);
@@ -128,3 +130,4 @@ extern unsigned int (*orig_stack_trace_save_tsk)(struct task_struct *task,
unsigned long *store,
unsigned int size,
unsigned int skipnr);
+extern struct task_struct *(*orig_find_task_by_vpid)(pid_t nr);