static bool __is_proc_mmap_mappable(struct task_struct *task)
{
struct vm_area_struct *linker_vma = __get_linker_vma(task);
+ struct sspt_proc *proc;
unsigned long r_debug_addr;
unsigned int state;
enum { r_state_offset = sizeof(int) + sizeof(void *) + sizeof(long) };
return false;
r_debug_addr += r_state_offset;
+ proc = sspt_proc_get_by_task(task);
+ if (proc)
+ proc->r_state_addr = r_debug_addr;
+
if (get_user(state, (unsigned long *)r_debug_addr))
return false;
#error "this architecture is not supported"
#endif /* CONFIG_arch */
+ if (data->addr) {
+ struct sspt_proc * proc = sspt_proc_get_by_task(current);
+
+ if (proc && (proc->r_state_addr == data->addr))
+ /* skip ret_handler_pf() for current task */
+ return 1;
+ }
+
return 0;
}
*/
struct sspt_proc *sspt_proc_create(struct task_struct *task)
{
- struct sspt_proc *proc = kmalloc(sizeof(*proc), GFP_ATOMIC);
+ struct sspt_proc *proc = kzalloc(sizeof(*proc), GFP_ATOMIC);
if (proc) {
proc->feature = sspt_create_feature();
proc->tgid = task->tgid;
proc->task = task->group_leader;
proc->sm = create_sm_us(task);
- proc->first_install = 0;
- proc->private_data = NULL;
INIT_LIST_HEAD(&proc->file_list);
INIT_LIST_HEAD(&proc->filter_list);
atomic_set(&proc->usage, 1);
struct list_head list; /**< For global process list */
pid_t tgid; /**< Thread group ID */
struct task_struct *task; /**< Ptr to the task */
+ unsigned long r_state_addr; /**< address of r_state */
struct slot_manager *sm; /**< Ptr to the manager slot */
struct list_head file_list; /**< For sspt_file */
struct list_head filter_list; /**< Filter list */