Revert "[IMPROVE] ARM: workaround for already running" 35/50535/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 29 Oct 2015 13:02:39 +0000 (16:02 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Fri, 30 Oct 2015 10:15:41 +0000 (03:15 -0700)
This reverts commit 3001e19e1ef5c4545623ec12a04fed64cba90ba2.

Conflicts:
us_manager/helper.c
us_manager/pf/pf_group.c
us_manager/pf/pf_group.h

Change-Id: I1b13b41c68fe61daabc7d7bc9f13c03ff797f270
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
us_manager/helper.c
us_manager/pf/pf_group.c
us_manager/pf/pf_group.h

index 5350999..e7bc3ed 100644 (file)
@@ -143,60 +143,6 @@ static void unregister_mf(void)
 
 
 
-#ifdef CONFIG_ARM
-/*
- ******************************************************************************
- *                       workaround for already running                       *
- ******************************************************************************
- */
-static unsigned long cb_check_and_install(void *data);
-
-static int ctx_task_pre_handler(struct kprobe *p, struct pt_regs *regs)
-{
-       int ret;
-       struct sspt_proc *proc;
-       struct task_struct *task = current;
-
-       if (is_kthread(task) || check_task_on_filters(task) == 0)
-               return 0;
-
-       proc = sspt_proc_get_by_task(task);
-       if (proc && proc->first_install)
-               return 0;
-
-       ret = set_kjump_cb(regs, cb_check_and_install, NULL, 0);
-       if (ret < 0)
-               pr_err("ctx_task_pre_handler: ret=%d\n", ret);
-
-       return 0;
-}
-
-static struct kprobe ctx_task_kprobe = {
-       .pre_handler = ctx_task_pre_handler,
-};
-
-static int register_ctx_task(void)
-{
-       int ret = 0;
-
-       ret = swap_register_kprobe(&ctx_task_kprobe);
-       if (ret)
-               printk(KERN_INFO "swap_register_kprobe(workaround) ret=%d!\n",
-                      ret);
-
-       return ret;
-}
-
-static void unregister_ctx_task(void)
-{
-       swap_unregister_kprobe(&ctx_task_kprobe);
-}
-#endif /* CONFIG_ARM */
-
-
-
-
-
 /*
  ******************************************************************************
  *                              copy_process()                                *
@@ -822,20 +768,8 @@ int register_helper(void)
        if (ret)
                goto unreg_mmap;
 
-#ifdef CONFIG_ARM
-       /* install probe to detect already running process */
-       ret = register_ctx_task();
-       if (ret)
-               goto unreg_mf;
-#endif /* CONFIG_ARM */
-
        return ret;
 
-#ifdef CONFIG_ARM
-unreg_mf:
-       unregister_mf();
-#endif /* CONFIG_ARM */
-
 unreg_mmap:
        unregister_mmap();
 
@@ -861,9 +795,6 @@ unreg_comm:
  */
 void unregister_helper_top(void)
 {
-#ifdef CONFIG_ARM
-       unregister_ctx_task();
-#endif /* CONFIG_ARM */
        unregister_mf();
        atomic_set(&stop_flag, 1);
 }
@@ -922,13 +853,6 @@ int once_helper(void)
        if (comm_kretprobe.kp.addr == NULL)
                goto not_found;
 
-#ifdef CONFIG_ARM
-       sym = "ret_to_user";
-       ctx_task_kprobe.addr = (kprobe_opcode_t *)swap_ksyms(sym);
-       if (ctx_task_kprobe.addr == NULL)
-               goto not_found;
-#endif /* CONFIG_ARM */
-
        return 0;
 
 not_found:
index 69715c0..2288610 100644 (file)
@@ -433,15 +433,7 @@ int pf_unregister_probe(struct pf_group *pfg, struct dentry *dentry,
 }
 EXPORT_SYMBOL_GPL(pf_unregister_probe);
 
-/**
- * @brief Check the task, to meet the filter criteria
- *
- * @prarm task Pointer on the task_struct struct
- * @return
- *       - 0 - false
- *       - 1 - true
- */
-int check_task_on_filters(struct task_struct *task)
+static int check_task_on_filters(struct task_struct *task)
 {
        int ret = 0;
        struct pf_group *pfg;
index 21f3ef8..3c170fa 100644 (file)
@@ -66,7 +66,6 @@ void uninstall_all(void);
 void get_all_procs(void);
 void put_all_procs(void);
 
-int check_task_on_filters(struct task_struct *task);
 void call_page_fault(struct task_struct *task, unsigned long page_addr);
 void call_mm_release(struct task_struct *task);
 void check_task_and_install(struct task_struct *task);