static void recover_child(struct task_struct *child_task, struct sspt_proc *proc)
{
- uninstall_us_proc_probes(child_task, proc, US_DISARM);
+ sspt_proc_uninstall(proc, child_task, US_DISARM);
dbi_disarm_urp_inst_for_task(current, child_task);
}
proc = sspt_proc_get_by_task(task);
if (proc) {
- int ret = uninstall_us_proc_probes(task, proc, US_UNREGS_PROBE);
+ int ret = sspt_proc_uninstall(proc, task, US_UNREGS_PROBE);
if (ret != 0) {
printk("failed to uninstall IPs (%d)!\n", ret);
}
*
*/
+#include "sspt.h"
#include "sspt_proc.h"
#include "sspt_page.h"
#include <linux/slab.h>
mm_read_unlock(mm, atomic, lock);
}
+
+int sspt_proc_uninstall(struct sspt_proc *proc, struct task_struct *task, enum US_FLAGS flag)
+{
+ int err = 0;
+ struct sspt_file *file;
+
+ list_for_each_entry_rcu(file, &proc->file_list, list) {
+ err = sspt_file_uninstall(file, task, flag);
+ if (err != 0) {
+ printk("ERROR sspt_proc_uninstall: err=%d\n", err);
+ return err;
+ }
+ }
+
+ return err;
+}
void sspt_proc_install_page(struct sspt_proc *proc, unsigned long page_addr);
void sspt_proc_install(struct sspt_proc *proc);
+int sspt_proc_uninstall(struct sspt_proc *proc, struct task_struct *task, enum US_FLAGS flag);
#endif /* __SSPT_PROC__ */
for_each_process(task) {
proc = sspt_proc_get_by_task(task);
if (proc) {
- int ret = uninstall_us_proc_probes(task, proc, US_UNREGS_PROBE);
+ int ret = sspt_proc_uninstall(proc, task, US_UNREGS_PROBE);
if (ret) {
EPRINTF ("failed to uninstall IPs (%d)!", ret);
}
void print_vma(struct mm_struct *mm);
-int uninstall_us_proc_probes(struct task_struct *task, struct sspt_proc *proc, enum US_FLAGS flag)
-{
- int err = 0;
- struct sspt_file *file;
-
- list_for_each_entry_rcu(file, &proc->file_list, list) {
- err = sspt_file_uninstall(file, task, flag);
- if (err != 0) {
- // TODO:
- return err;
- }
- }
-
- return err;
-}
-
void print_vma(struct mm_struct *mm)
{
struct vm_area_struct *vma;
unsigned long jp_handler,
uretprobe_handler_t rp_handler);
-int uninstall_us_proc_probes(struct task_struct *task, struct sspt_proc *proc, enum US_FLAGS flag);
int check_vma(struct vm_area_struct *vma);
#endif /* !defined(__US_PROC_INST_H__) */