summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2015-08-30 16:14:14 +0300
committerVasiliy Ulyanov <v.ulyanov@samsung.com>2015-09-07 01:09:55 -0700
commit82ae9bb832e8120c532cc22cbf59e1f4602d5ebd (patch)
tree8af3d1f6bc380c06fa849cfa94cbaa1e3e05e9c3
parent54afb0ed500295bb79a045a0fbde60ca5c0771b1 (diff)
downloadswap-modules-82ae9bb832e8120c532cc22cbf59e1f4602d5ebd.tar.gz
swap-modules-82ae9bb832e8120c532cc22cbf59e1f4602d5ebd.tar.bz2
swap-modules-82ae9bb832e8120c532cc22cbf59e1f4602d5ebd.zip
[IMPROVE] Do not call cb_clean_child on non instrumented process
Change-Id: I86767ac7dbb62e537e82ffa0062d1472c792887d Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
-rw-r--r--us_manager/helper.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/us_manager/helper.c b/us_manager/helper.c
index 37e48820..2e71afdf 100644
--- a/us_manager/helper.c
+++ b/us_manager/helper.c
@@ -254,7 +254,6 @@ static unsigned long cb_clean_child(void *data)
static void rm_uprobes_child(struct kretprobe_instance *ri,
struct pt_regs *regs, struct task_struct *child)
{
- int ret;
struct sspt_proc *proc;
struct clean_data cdata = {
.task = child,
@@ -263,20 +262,22 @@ static void rm_uprobes_child(struct kretprobe_instance *ri,
};
sspt_proc_write_lock();
-
proc = sspt_proc_get_by_task(current);
if (proc) {
sspt_proc_on_each_ip(proc, func_uinst_creare, (void *)&cdata.head);
urinst_info_get_current_hlist(&cdata.rhead);
}
-
sspt_proc_write_unlock();
- /* set jumper */
- ret = set_jump_cb((unsigned long)ri->ret_addr, regs, cb_clean_child,
- &cdata, sizeof(cdata));
- if (ret == 0)
- ri->ret_addr = (unsigned long *)get_jump_addr();
+ if (proc) {
+ int ret;
+
+ /* set jumper */
+ ret = set_jump_cb((unsigned long)ri->ret_addr, regs,
+ cb_clean_child, &cdata, sizeof(cdata));
+ if (ret == 0)
+ ri->ret_addr = (unsigned long *)get_jump_addr();
+ }
}