int dbi_disarm_urp_inst(struct kretprobe_instance *ri, struct task_struct *rm_task);
+/* Called with kretprobe_lock held */
int dbi_disarm_urp_inst_for_task(struct task_struct *parent, struct task_struct *task)
{
- int i, ret;
- unsigned long table_size, flags;
struct kretprobe_instance *ri;
struct hlist_node *node, *tmp;
- struct hlist_head *head;
-
- table_size = (1 << KPROBE_HASH_BITS);
+ struct hlist_head *head = kretprobe_inst_table_head(parent->mm);
- spin_lock_irqsave(&kretprobe_lock, flags);
- for (i = 0; i < table_size; ++i) {
- head = &kretprobe_inst_table[i];
- hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
- if (parent == ri->task) {
- dbi_disarm_urp_inst(ri, task);
- }
+ hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
+ if (parent == ri->task && ri->rp->kp.tgid) {
+ dbi_disarm_urp_inst(ri, task);
}
}
- spin_unlock_irqrestore(&kretprobe_lock, flags);
return 0;
}