[FIX] create sspt_proc struct only by group leader
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 5 Dec 2013 14:44:25 +0000 (18:44 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 5 Dec 2013 15:05:18 +0000 (19:05 +0400)
Change-Id: Ic432caf4e0c0969c126668781007574770a6c3ae
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
us_manager/helper.c
us_manager/pf/pf_group.c
us_manager/sspt/sspt_proc.c

index 625edf2..7ee6c1e 100644 (file)
@@ -58,10 +58,9 @@ static int entry_handler_mf(struct kretprobe_instance *ri, struct pt_regs *regs)
 /* Detects when IPs are really loaded into phy mem and installs probes. */
 static int ret_handler_mf(struct kretprobe_instance *ri, struct pt_regs *regs)
 {
-       struct task_struct *task;
+       struct task_struct *task = current;
        unsigned long page_addr;
 
-       task = current->group_leader;
        if (is_kthread(task))
                return 0;
 
index fcab09c..4bd2c3e 100644 (file)
@@ -227,7 +227,7 @@ void call_page_fault(struct task_struct *task, unsigned long page_addr)
                        continue;
 
                proc = get_proc_by_pfg(pfg, task);
-               if (proc == NULL) {
+               if (proc == NULL && task->tgid == task->pid) {
                        proc = new_proc_by_pfg(pfg, task);
                        pfg_first = pfg;
                }
index a0525a5..3fe2546 100644 (file)
@@ -70,8 +70,8 @@ struct sspt_proc *sspt_proc_create(struct task_struct *task, void *priv)
                }
 
                INIT_LIST_HEAD(&proc->list);
-               proc->tgid = task ? task->tgid : 0;
-               proc->task = task;
+               proc->tgid = task->tgid;
+               proc->task = task->group_leader;
                proc->sm = create_sm_us(task);
                proc->first_install = 0;
                INIT_LIST_HEAD(&proc->file_list);