Fixed deleted string in storage and application GOT addresses
authorAlexander Aksenov <a.aksenov@samsung.com>
Tue, 6 Nov 2012 11:18:15 +0000 (15:18 +0400)
committerAlexander Aksenov <a.aksenov@samsung.com>
Tue, 6 Nov 2012 11:18:15 +0000 (15:18 +0400)
driver/storage.c
driver/us_proc_inst.c

index 4dc1555..aca1017 100644 (file)
@@ -916,6 +916,7 @@ char *find_lib_path(const char *lib_name)
        return NULL;
 }
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 27)
 #define list_for_each_rcu(pos, head) __list_for_each_rcu(pos, head)
 #endif
 
index af50347..ea8e1be 100644 (file)
@@ -1593,9 +1593,18 @@ void find_plt_address(struct kretprobe_instance *probe, us_proc_ip_t * ip)
                {
                        if (addr == p_lib->p_plt[i].func_addr + p_lib->vma_start)
                        {
-                               if (!read_proc_vm_atomic(current, (unsigned long)(p_lib->p_plt[i].got_addr + p_lib->vma_start), &real_addr, sizeof(unsigned long)))
+                               unsigned real_got;
+                               if (strcmp(p_lib->path, task_inst_info->path))
                                {
-                                       printk("Failed to read memory %p!\n", p_lib->p_plt[i].got_addr + p_lib->vma_start);
+                                       real_got = p_lib->p_plt[i].got_addr + p_lib->vma_start;
+                               }
+                               else
+                               {
+                                       real_got = p_lib->p_plt[i].got_addr;
+                               }
+                               if (!read_proc_vm_atomic(current, (unsigned long)(real_got), &real_addr, sizeof(unsigned long)))
+                               {
+                                       printk("Failed to read got %p at memory address %p!\n", p_lib->p_plt[i].got_addr, real_got);
                                        break;
                                }
                                if (real_addr != p_lib->p_plt[i].real_func_addr)